Add swaylock

This commit is contained in:
Natsu Kagami 2022-04-28 11:37:51 -04:00
parent acb3968daf
commit d1366a95c6
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
3 changed files with 23 additions and 0 deletions

View file

@ -104,6 +104,10 @@ in
"${mod}+Shift+r" = "mode resize";
## Screenshot
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui";
## Locking
"${mod}+semicolon" = "exec ${pkgs.swaylock}/bin/swaylock"
+ (if cfg.wallpaper == "" then "" else " -i ${cfg.wallpaper} -s fit")
+ " -l -k";
} // (
# Map the workspaces
builtins.listToAttrs (lib.flatten (map

View file

@ -0,0 +1,17 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.services.swaylock;
in
{
options.services.swaylock = {
enable = mkEnableOption "Enable swaylock";
package = mkOption {
type = types.package;
default = pkgs.swaylock;
};
};
config = mkIf cfg.enable {
security.pam.services.swaylock.text = readFile "${cfg.package}/etc/pam.d/swaylock";
};
}

View file

@ -13,6 +13,7 @@
../modules/personal/fonts
# Some PAM stuff
../modules/services/pam/gnome-keyring.nix
../modules/services/swaylock.nix
../modules/services/input-remapper.nix
];
# Use the latest kernel
@ -147,6 +148,7 @@
# List services that you want to enable:
nki.services.pam.enableGnomeKeyring = true;
services.input-remapper.enable = true;
services.swaylock.enable = true;
# Enable the OpenSSH daemon.
services.openssh.enable = true;