pinwheel: Add enable option to swaylock module
This commit is contained in:
@@ -78,6 +78,7 @@
|
|||||||
nix-index.enable = true;
|
nix-index.enable = true;
|
||||||
greetd.enable = true;
|
greetd.enable = true;
|
||||||
hyprland.enable = true;
|
hyprland.enable = true;
|
||||||
|
swaylock.enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
openvpn.enable = true;
|
openvpn.enable = true;
|
||||||
go.enable = true;
|
go.enable = true;
|
||||||
|
|||||||
@@ -1,36 +1,45 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
let
|
let
|
||||||
|
enabled = config.mod.swaylock.enable;
|
||||||
hyprlandEnabled = config.mod.hyprland.enable;
|
hyprlandEnabled = config.mod.hyprland.enable;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.alex = {
|
options = {
|
||||||
programs.swaylock = {
|
mod.swaylock = {
|
||||||
enable = true;
|
enable = lib.mkEnableOption "enable swaylock module";
|
||||||
|
|
||||||
settings = {
|
|
||||||
color = "000000";
|
|
||||||
indicator-idle-visible = false;
|
|
||||||
show-failed-attempts = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
|
|
||||||
settings = {
|
|
||||||
bind = [
|
|
||||||
"$mod SHIFT, x, exec, ${pkgs.swaylock}/bin/swaylock -f && systemctl suspend"
|
|
||||||
"$mod, x, exec, ${pkgs.playerctl}/bin/playerctl -p spotify pause; ${pkgs.swaylock}/bin/swaylock"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
security = {
|
config = lib.mkIf enabled {
|
||||||
polkit.enable = true;
|
home-manager.users.alex = {
|
||||||
|
programs.swaylock = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
pam.services.swaylock.text = ''
|
settings = {
|
||||||
# PAM configuration file for the swaylock screen locker. By default, it includes
|
color = "000000";
|
||||||
# the 'login' configuration file (see /etc/pam.d/login)
|
indicator-idle-visible = false;
|
||||||
auth include login
|
show-failed-attempts = true;
|
||||||
'';
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
|
||||||
|
settings = {
|
||||||
|
bind = [
|
||||||
|
"$mod SHIFT, x, exec, ${pkgs.swaylock}/bin/swaylock -f && systemctl suspend"
|
||||||
|
"$mod, x, exec, ${pkgs.playerctl}/bin/playerctl -p spotify pause; ${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
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user