From 315dcf3cbff0980495c0899a38ecdf538651dabc Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 5 Feb 2021 17:48:54 +0100 Subject: krebs.setuid: make wrapperDir configurable --- krebs/3modules/setuid.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/setuid.nix b/krebs/3modules/setuid.nix index 3e068736b..64fedb911 100644 --- a/krebs/3modules/setuid.nix +++ b/krebs/3modules/setuid.nix @@ -9,8 +9,6 @@ with import ; api = mkOption { default = {}; type = let - # TODO make wrapperDir configurable - inherit (config.security) wrapperDir; inherit (config.users) groups users; in types.attrsOf (types.submodule (self: let cfg = self.config; in { options = { @@ -49,6 +47,10 @@ with import ; merge = mergeOneOption; }; }; + wrapperDir = mkOption { + default = config.security.wrapperDir; + type = types.absolute-pathname; + }; activate = mkOption { type = types.str; visible = false; @@ -59,8 +61,9 @@ with import ; src = pkgs.exec cfg.name { inherit (cfg) envp filename; }; - dst = "${wrapperDir}/${cfg.name}"; + dst = "${cfg.wrapperDir}/${cfg.name}"; in '' + mkdir -p ${cfg.wrapperDir} cp ${src} ${dst} chown ${cfg.owner}.${cfg.group} ${dst} chmod ${cfg.mode} ${dst} -- cgit v1.2.3