diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index 3452425..374f942 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -18,6 +18,7 @@ ./modules/vim ./modules/foot ./modules/hyprland + ./modules/swaylock ./modules/syncthing ./modules/firefox ./modules/calibre @@ -64,7 +65,6 @@ LC_TIME = "sv_SE.UTF-8"; }; - security.polkit.enable = true; hardware.opengl.enable = true; programs.dconf.enable = true; @@ -116,12 +116,6 @@ }]; }; - security.pam.services.swaylock.text = '' - # PAM configuration file for the swaylock screen locker. By default, it includes - # the 'login' configuration file (see /etc/pam.d/login) - auth include login - ''; - # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; diff --git a/hosts/pinwheel/home.nix b/hosts/pinwheel/home.nix index 954bbce..16ef208 100644 --- a/hosts/pinwheel/home.nix +++ b/hosts/pinwheel/home.nix @@ -41,16 +41,6 @@ style = ''''; - programs.swaylock = { - enable = true; - - settings = { - color = "000000"; - indicator-idle-visible = false; - show-failed-attempts = true; - }; - }; - services.dunst.enable = true; home.stateVersion = "23.05"; diff --git a/hosts/pinwheel/modules/hyprland/default.nix b/hosts/pinwheel/modules/hyprland/default.nix index 342e5dc..ee9c844 100644 --- a/hosts/pinwheel/modules/hyprland/default.nix +++ b/hosts/pinwheel/modules/hyprland/default.nix @@ -1,4 +1,4 @@ -{ home-manager, pkgs, ... }: +{ home-manager, ... }: { home-manager.users.alex = { wayland.windowManager.hyprland = { @@ -66,7 +66,6 @@ move = builtins.genList (x: "$mod SHIFT, ${ws x}, movetoworkspacesilent, ${builtins.toString (x + 1)}") 10; in select ++ move ++ [ - "$mod, x, exec, ${pkgs.swaylock}/bin/swaylock" "$mod SHIFT, x, exec, systemctl suspend" "$mod, SPACE, exec, bemenu-run --fn 'DejaVuSansM Nerd Font Mono 14'" diff --git a/hosts/pinwheel/modules/swaylock/default.nix b/hosts/pinwheel/modules/swaylock/default.nix new file mode 100644 index 0000000..42e79cb --- /dev/null +++ b/hosts/pinwheel/modules/swaylock/default.nix @@ -0,0 +1,32 @@ +{ home-manager, pkgs, ... }: +{ + home-manager.users.alex = { + programs.swaylock = { + enable = true; + + settings = { + color = "000000"; + indicator-idle-visible = false; + show-failed-attempts = true; + }; + }; + + wayland.windowManager.hyprland = { + settings = { + bind = [ + "$mod, x, exec, ${pkgs.swaylock}/bin/swaylock" + ]; + }; + }; + }; + + security = { + polkit.enable = true; + + pam.services.swaylock.text = '' + # PAM configuration file for the swaylock screen locker. By default, it includes + # the 'login' configuration file (see /etc/pam.d/login) + auth include login + ''; + }; +}