Add swaylock
This commit is contained in:
parent
acb3968daf
commit
d1366a95c6
|
@ -104,6 +104,10 @@ in
|
||||||
"${mod}+Shift+r" = "mode resize";
|
"${mod}+Shift+r" = "mode resize";
|
||||||
## Screenshot
|
## Screenshot
|
||||||
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui";
|
"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
|
# Map the workspaces
|
||||||
builtins.listToAttrs (lib.flatten (map
|
builtins.listToAttrs (lib.flatten (map
|
||||||
|
|
17
modules/services/swaylock.nix
Normal file
17
modules/services/swaylock.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
|
@ -13,6 +13,7 @@
|
||||||
../modules/personal/fonts
|
../modules/personal/fonts
|
||||||
# Some PAM stuff
|
# Some PAM stuff
|
||||||
../modules/services/pam/gnome-keyring.nix
|
../modules/services/pam/gnome-keyring.nix
|
||||||
|
../modules/services/swaylock.nix
|
||||||
../modules/services/input-remapper.nix
|
../modules/services/input-remapper.nix
|
||||||
];
|
];
|
||||||
# Use the latest kernel
|
# Use the latest kernel
|
||||||
|
@ -147,6 +148,7 @@
|
||||||
# List services that you want to enable:
|
# List services that you want to enable:
|
||||||
nki.services.pam.enableGnomeKeyring = true;
|
nki.services.pam.enableGnomeKeyring = true;
|
||||||
services.input-remapper.enable = true;
|
services.input-remapper.enable = true;
|
||||||
|
services.swaylock.enable = true;
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
Loading…
Reference in a new issue