diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index ca4c9e0..458d8c4 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -78,7 +78,8 @@ nix-index.enable = true; greetd.enable = true; hyprland.enable = true; - swaylock.enable = true; + swaylock.enable = false; + physlock.enable = true; git.enable = true; openvpn.enable = true; go.enable = true; diff --git a/hosts/pinwheel/modules/hyprland/default.nix b/hosts/pinwheel/modules/hyprland/default.nix index e9e3841..e7019ea 100644 --- a/hosts/pinwheel/modules/hyprland/default.nix +++ b/hosts/pinwheel/modules/hyprland/default.nix @@ -24,6 +24,8 @@ in env = GDK_DPI_SCALE,1.5 env = XCURSOR_SIZE,64 + monitor=eDP-1, 1920x1200, 0x0, 1 + workspace = 1, monitor:HDMI-A-1 workspace = 2, monitor:HDMI-A-1 workspace = 3, monitor:HDMI-A-1 diff --git a/hosts/pinwheel/modules/physlock/default.nix b/hosts/pinwheel/modules/physlock/default.nix new file mode 100644 index 0000000..78c647d --- /dev/null +++ b/hosts/pinwheel/modules/physlock/default.nix @@ -0,0 +1,42 @@ +{ pkgs, lib, config, ... }: +let + enabled = config.mod.physlock.enable; + hyprlandEnabled = config.mod.hyprland.enable; +in +{ + options = { + mod.physlock = { + enable = lib.mkEnableOption "enable physlock module"; + }; + }; + + config = lib.mkIf enabled { + services.physlock = { + enable = true; + + # Wraps the `physlock` binary in a "wrapper" which allows any + # user to run the wrapper (located in `config.security.wrapperDir`) + allowAnyUser = true; + + lockOn = { + hibernate = true; + suspend = true; + }; + }; + + home-manager.users.alex = { + wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { + settings = { + bind = + let + pause-music = "${pkgs.playerctl}/bin/playerctl -p spotify pause"; + in + [ + "$mod SHIFT, x, exec, ${pause-music}; systemctl suspend" + "$mod, x, exec, ${pause-music}; ${config.security.wrapperDir}/physlock -d -s -m" + ]; + }; + }; + }; + }; +}