diff options
Diffstat (limited to 'krebs/3modules/setuid.nix')
-rw-r--r-- | krebs/3modules/setuid.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/krebs/3modules/setuid.nix b/krebs/3modules/setuid.nix index 64fedb911..6ad2f1264 100644 --- a/krebs/3modules/setuid.nix +++ b/krebs/3modules/setuid.nix @@ -30,6 +30,10 @@ with import <stockholm/lib>; }; apply = toString; }; + capabilities = mkOption { + default = []; + type = types.listOf types.str; + }; owner = mkOption { default = "root"; type = types.enum (attrNames users); @@ -67,6 +71,9 @@ with import <stockholm/lib>; cp ${src} ${dst} chown ${cfg.owner}.${cfg.group} ${dst} chmod ${cfg.mode} ${dst} + ${optionalString (cfg.capabilities != []) /* sh */ '' + ${pkgs.libcap.out}/bin/setcap ${concatMapStringsSep "," shell.escape cfg.capabilities} ${dst} + ''} ''; })); }; |