ctucx.git: nixfiles

ctucx' nixfiles

commit d3bbac1e5f6df52ece2fee8c327b4e068edb428c
parent 35b880d7bc3c697c79a0e811887b9c7dd5162b8a
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 10 Oct 2021 20:13:15 +0200

programs/swaylock: add
1 file changed, 23 insertions(+), 0 deletions(-)
A
configurations/programs/swaylock.nix
|
23
+++++++++++++++++++++++
diff --git a/configurations/programs/swaylock.nix b/configurations/programs/swaylock.nix
@@ -0,0 +1,23 @@
+{ config, pkgs, ... }:
+
+{
+  security.pam.services.swaylock = {};
+
+  home-manager.users.leah.systemd.user.services = {
+    swaylock = {
+      Unit = {
+        Requisite = [ "graphical-session.target" ];
+        PartOf    = [ "lock.target" ];
+      };
+
+      Service = {
+        ExecStart    = "${pkgs.swaylock}/bin/swaylock -i /home/leah/Pictures/Backgrounds/lock.png";
+        ExecStopPost = "${pkgs.systemd}/bin/loginctl unlock-session";
+      };
+
+      Install = {
+        WantedBy = [ "lock.target" ];
+      };
+    };
+  };
+}