zaphyra's git: nixfiles

zaphyra's nixfiles

commit d6a08ec4c0f8a04a45e9bbcf196a1f7db0c1681b
parent 204f77889bd71091ac00118f835bcfee58f82c7f
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Thu, 7 Aug 2025 12:45:07 +0200

config/home-manager/zaphyra/programs: add `swaylock`
3 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/config/home-manager/zaphyra/configure/niri.nix b/config/home-manager/zaphyra/configure/niri.nix
@@ -25,6 +25,7 @@ in
     services.wlsunset
     services.playerctl
 
+    programs.swaylock
     programs.fuzzel
     programs.ghostty
     programs.sherlock
diff --git a/config/home-manager/zaphyra/programs/swaylock.nix b/config/home-manager/zaphyra/programs/swaylock.nix
@@ -0,0 +1,35 @@
+{ config, lib, pkgs, ... }:
+
+{
+
+  programs.swaylock = {
+    enable = true;
+    package = pkgs.swaylock-effects;
+    settings = {
+      clock = true;
+
+      indicator = true;
+      ring-color = "4aa96c";
+      show-failed-attempts = true;
+
+      image = "/home/zaphyra/Pictures/Backgrounds/lock.png";
+      scaling = "fit";
+      color = "ffffaf";
+    };
+  };
+
+  systemd.user.services.swaylock = {
+    Unit = {
+      OnSuccess = [ "unlock.target" ];
+      PartOf = [ "lock.target" ];
+      After = [ "lock.target" ];
+    };
+    Service = {
+      ExecStart = lib.getExe config.programs.swaylock.package;
+      Restart = "on-failure";
+      RestartSec = 0;
+    };
+    Install.WantedBy = [ "lock.target" ];
+  };
+
+}+
\ No newline at end of file
diff --git a/config/nixos/modules/services/swaylock.nix b/config/nixos/modules/services/swaylock.nix
@@ -25,12 +25,12 @@ in
     home-manager.sharedModules = [
       {
         systemd.user.services = {
-          swaylock = {
+          swaylock = lib.mkDefault {
             Unit.OnSuccess = [ "unlock.target" ];
             Unit.PartOf = [ "lock.target" ];
             Unit.After = [ "lock.target" ];
             Install.WantedBy = [ "lock.target" ];
-            Service.ExecStart = "${lib.getExe pkgs.swaylock} -i /home/zaphyra/Pictures/Backgrounds/lock.png --scaling fit --color ffffaf";
+            Service.ExecStart = lib.getExe pkgs.swaylock;
             Service.Restart = "on-failure";
             Service.RestartSec = 0;
           };