diff --git a/lock-suspend.nix b/lock-suspend.nix index e655fe7..764ae26 100644 --- a/lock-suspend.nix +++ b/lock-suspend.nix @@ -13,13 +13,15 @@ timeout = 0 ''; }; - - systemd.user.services.hyprlock-pre-suspend = { + systemd.services.hyprlock-pre-suspend = { description = "Lock screen before suspend"; + wants = [ "sleep.target" ]; + before = [ "sleep.target" ]; serviceConfig = { Type = "oneshot"; + User = "odweta"; # run as your user ExecStart = "${pkgs.hyprlock}/bin/hyprlock -c /etc/hypr/hyprlock.conf"; }; - wantedBy = [ "sleep.target" ]; + install.wantedBy = [ "sleep.target" ]; }; }