summary refs log tree commit diff
diff options
context:
space:
mode:
authorScott R. Parish <srparish@gmail.com>2017-03-30 14:22:31 -0700
committerScott R. Parish <srparish@gmail.com>2017-03-30 14:36:53 -0700
commit7138b559189defc1426df800ca713d43a9aacbe7 (patch)
treec61137203376cbffbf6b25ac03ecc9b629d91ac1
parent163668f6c4ca3db6690eeaba54afc1e755833b4e (diff)
downloadnixlib-7138b559189defc1426df800ca713d43a9aacbe7.tar
nixlib-7138b559189defc1426df800ca713d43a9aacbe7.tar.gz
nixlib-7138b559189defc1426df800ca713d43a9aacbe7.tar.bz2
nixlib-7138b559189defc1426df800ca713d43a9aacbe7.tar.lz
nixlib-7138b559189defc1426df800ca713d43a9aacbe7.tar.xz
nixlib-7138b559189defc1426df800ca713d43a9aacbe7.tar.zst
nixlib-7138b559189defc1426df800ca713d43a9aacbe7.zip
slock: needs the ability to be install with suid privileges
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/slock.nix26
2 files changed, 27 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 0035368273ca..7730f81cfa72 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";
+  };
+}