From 0b2af1214889efbd5eb39589f7bd0b8c52eac3bb Mon Sep 17 00:00:00 2001 From: Emmet Date: Thu, 4 Apr 2024 14:09:46 -0500 Subject: [PATCH 1/3] Use stable for servers and unstable for other --- flake.nix | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index f56a62e..42b01c9 100644 --- a/flake.nix +++ b/flake.nix @@ -58,14 +58,20 @@ }; # configure pkgs - pkgs = import nixpkgs-patched { - system = systemSettings.system; - config = { - allowUnfree = true; - allowUnfreePredicate = (_: true); - }; - overlays = [ rust-overlay.overlays.default ]; - }; + # use nixpkgs if running a server (homelab or worklab profile) + # otherwise use patched nixos-unstable nixpkgs + pkgs = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab")) + then + pkgs-stable + else + (import nixpkgs-patched { + system = systemSettings.system; + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + }; + overlays = [ rust-overlay.overlays.default ]; + })); pkgs-stable = import nixpkgs-stable { system = systemSettings.system; @@ -84,7 +90,13 @@ }; # configure lib - lib = nixpkgs.lib; + # use nixpkgs if running a server (homelab or worklab profile) + # otherwise use patched nixos-unstable nixpkgs + lib = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab")) + then + nixpkgs-stable.lib + else + nixpkgs.lib); # Systems that can run tests: supportedSystems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ]; From 102142bf8e96723bd49dac3260f1b0611de4346d Mon Sep 17 00:00:00 2001 From: Emmet Date: Thu, 4 Apr 2024 16:59:07 -0500 Subject: [PATCH 2/3] Tried hyprdim, but doesn't work atm --- user/wm/hyprland/hyprland.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index 5cfa622..9fb3507 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -42,6 +42,7 @@ exec-once = emacs --daemon exec-once = hypridle + #exec-once = hyprdim # currently broken :( exec-once = obs-notification-mute-daemon exec = ~/.swaybg-stylix @@ -293,6 +294,7 @@ hypridle hyprlock hyprnome + hyprdim swaybg fnott fuzzel From e298eee2a1788e9ec00f71dc95dcff099468572f Mon Sep 17 00:00:00 2001 From: Emmet Date: Thu, 4 Apr 2024 16:59:18 -0500 Subject: [PATCH 3/3] Time and lid based autolocking --- user/wm/hyprland/hyprland.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index 9fb3507..e6cf8a3 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -138,7 +138,8 @@ bind=SUPER,C,exec,wl-copy $(hyprpicker) bind=SUPERSHIFT,S,exec,systemctl suspend - bind=SUPERCTRL,L,exec,hyprlock + bindl=,switch:on:Lid Switch,exec,loginctl lock-session + bind=SUPERCTRL,L,exec,loginctl lock-session bind=SUPER,H,movefocus,l bind=SUPER,J,movefocus,d @@ -388,9 +389,13 @@ } listener { - timeout = 600 # in seconds + timeout = 300 # in seconds on-timeout = loginctl lock-session } + listener { + timeout = 600 # in seconds + on-timeout = systemctl suspend + } ''; home.file.".config/hypr/hyprlock.conf".text = '' background {