summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-07-04 11:33:54 +0200
committertv <tv@krebsco.de>2023-07-04 11:35:26 +0200
commit512232b72a5eab6a63a7e23ff1371b2821d5b065 (patch)
treef4785c36f0773e9d1d8697d2ba37d5f549327007 /krebs
parent0e6c1e2d948244d2fe3295740bea94a1c42bc836 (diff)
permown: fix flakify fuckups
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/permown.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/krebs/3modules/permown.nix b/krebs/3modules/permown.nix
index 3ebbc44fe..ae8702978 100644
--- a/krebs/3modules/permown.nix
+++ b/krebs/3modules/permown.nix
@@ -1,4 +1,6 @@
-{ config, pkgs, lib, ... }:
+{ config, pkgs, lib, ... }: let
+ slib = import ../../lib/pure.nix { inherit lib; };
+in
with lib; {
options.krebs.permown = mkOption {
@@ -16,7 +18,7 @@ with 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 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 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}; } || :"