ctucx.git: nixfiles

ctucx' nixfiles

commit dd83995bda05fc9543a38b7b7c3d63ab41d33909
parent 86793f34881ca41c5f72f151798a90d4119bb2b2
Author: Leah (ctucx) <leah@ctu.cx>
Date: Wed, 12 Jan 2022 19:31:40 +0100

programs/swaylock: start when reaching sleep.target on stasicontainer
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/configurations/programs/swaylock.nix b/configurations/programs/swaylock.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ config, pkgs, ... }:
 
 {
   security.pam.services.swaylock = {};

@@ -7,7 +7,11 @@
     swaylock = {
       Unit = {
         Requisite = [ "graphical-session.target" ];
-        PartOf    = [ "lock.target" ];
+        PartOf    = [
+          "lock.target"
+        ]  ++ (if config.networking.hostName == "stasicontainer" then [
+         "sleep.target"
+        ] else []);
       };
 
       Service = {

@@ -16,7 +20,11 @@
       };
 
       Install = {
-        WantedBy = [ "lock.target" ];
+        WantedBy = [
+          "lock.target"
+        ]  ++ (if config.networking.hostName == "stasicontainer" then [
+         "sleep.target"
+        ] else []);
       };
     };
   };