diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 0cd02d259e45..52de4b23370b 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -89,6 +89,7 @@ ./programs/nano.nix ./programs/oblogout.nix ./programs/screen.nix + ./programs/slock.nix ./programs/shadow.nix ./programs/shell.nix ./programs/spacefm.nix diff --git a/nixos/modules/programs/slock.nix b/nixos/modules/programs/slock.nix new file mode 100644 index 000000000000..0e1281e62cd7 --- /dev/null +++ b/nixos/modules/programs/slock.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.slock; + +in +{ + options = { + programs.slock = { + enable = mkOption { + default = false; + type = types.bool; + description = '' + Whether to install slock screen locker with setuid wrapper. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ pkgs.slock ]; + security.wrappers.slock.source = "${pkgs.slock.out}/bin/slock"; + }; +}