1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00
nixpkgs/nixos/modules/programs/slock.nix

33 lines
611 B
Nix

{ 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.
'';
};
package = mkPackageOption pkgs "slock" {};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
security.wrappers.slock =
{ setuid = true;
owner = "root";
group = "root";
source = lib.getExe cfg.package;
};
};
}