summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/permown.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules/permown.nix')
-rw-r--r--krebs/3modules/permown.nix20
1 files changed, 11 insertions, 9 deletions
diff --git a/krebs/3modules/permown.nix b/krebs/3modules/permown.nix
index ca81e2ea..ae870297 100644
--- a/krebs/3modules/permown.nix
+++ b/krebs/3modules/permown.nix
@@ -1,5 +1,7 @@
-with import <stockholm/lib>;
-{ config, pkgs, ... }: {
+{ config, pkgs, lib, ... }: let
+ slib = import ../../lib/pure.nix { inherit lib; };
+in
+with lib; {
options.krebs.permown = mkOption {
default = {};
@@ -16,7 +18,7 @@ with import <stockholm/lib>;
group = mkOption {
apply = x: if x == null then "" else x;
default = null;
- type = types.nullOr types.groupname;
+ type = types.nullOr slib.types.groupname;
};
keepGoing = mkOption {
default = false;
@@ -28,15 +30,15 @@ with import <stockholm/lib>;
'';
};
owner = mkOption {
- type = types.username;
+ type = slib.types.username;
};
path = mkOption {
default = config._module.args.name;
- type = types.absolute-pathname;
+ type = slib.types.absolute-pathname;
};
umask = mkOption {
default = "0027";
- type = types.file-mode;
+ type = slib.types.file-mode;
};
};
}));
@@ -48,11 +50,11 @@ with import <stockholm/lib>;
system.activationScripts.permown = let
mkdir = plan: /* sh */ ''
- ${pkgs.coreutils}/bin/mkdir -p ${shell.escape plan.path}
+ ${pkgs.coreutils}/bin/mkdir -p ${slib.shell.escape plan.path}
'';
in concatMapStrings mkdir plans;
- systemd.services = genAttrs' plans (plan: let
+ systemd.services = slib.genAttrs' plans (plan: let
continuable = command:
if plan.keepGoing
then /* sh */ "{ ${command}; } || :"
@@ -69,7 +71,7 @@ with import <stockholm/lib>;
path = [
pkgs.coreutils
pkgs.findutils
- pkgs.inotifyTools
+ pkgs.inotify-tools
];
serviceConfig = {
ExecStart = pkgs.writeDash "permown" ''