pinwheel: Add and use physlock module
This commit is contained in:
@@ -78,7 +78,8 @@
|
|||||||
nix-index.enable = true;
|
nix-index.enable = true;
|
||||||
greetd.enable = true;
|
greetd.enable = true;
|
||||||
hyprland.enable = true;
|
hyprland.enable = true;
|
||||||
swaylock.enable = true;
|
swaylock.enable = false;
|
||||||
|
physlock.enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
openvpn.enable = true;
|
openvpn.enable = true;
|
||||||
go.enable = true;
|
go.enable = true;
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ in
|
|||||||
env = GDK_DPI_SCALE,1.5
|
env = GDK_DPI_SCALE,1.5
|
||||||
env = XCURSOR_SIZE,64
|
env = XCURSOR_SIZE,64
|
||||||
|
|
||||||
|
monitor=eDP-1, 1920x1200, 0x0, 1
|
||||||
|
|
||||||
workspace = 1, monitor:HDMI-A-1
|
workspace = 1, monitor:HDMI-A-1
|
||||||
workspace = 2, monitor:HDMI-A-1
|
workspace = 2, monitor:HDMI-A-1
|
||||||
workspace = 3, monitor:HDMI-A-1
|
workspace = 3, monitor:HDMI-A-1
|
||||||
|
|||||||
42
hosts/pinwheel/modules/physlock/default.nix
Normal file
42
hosts/pinwheel/modules/physlock/default.nix
Normal file
@@ -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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user