diff options
| author | spl3g <notspl3g@duck.com> | 2026-03-18 18:01:41 +0300 |
|---|---|---|
| committer | spl3g <notspl3g@duck.com> | 2026-03-18 18:01:59 +0300 |
| commit | 03648b3d9f177227df40129bed22558f6924b91c (patch) | |
| tree | 8a22eda142beeafd9002a8d5901ba9428a77ad52 /nixos/serverModules/directories.nix | |
| parent | dc19a2b583b3ab50d8e36ff0a90ca633495f675f (diff) | |
so.. v2 i guess
Diffstat (limited to 'nixos/serverModules/directories.nix')
| -rw-r--r-- | nixos/serverModules/directories.nix | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/nixos/serverModules/directories.nix b/nixos/serverModules/directories.nix deleted file mode 100644 index f5c769f..0000000 --- a/nixos/serverModules/directories.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; let - cfg = config.createPaths; - pathAttrsToListRec = pathsAttrSet: parentPath: parentConfig: - lib.flatten (lib.mapAttrsToList (path: config: let - filteredConfig = lib.filterAttrs (n: v: v != null) (builtins.removeAttrs config ["subPaths"]); - out = - { - path = - if parentPath == "" - then path - else parentPath + "/" + path; - } - // parentConfig // filteredConfig; - in - if config ? subPaths - then [out] ++ (pathAttrsToListRec config.subPaths path filteredConfig) - else [out]) - pathsAttrSet); - pathConfig = { - options = { - group = mkOption { - type = types.nullOr types.str; - default = null; - }; - owner = mkOption { - type = types.nullOr types.str; - default = null; - }; - permissions = mkOption { - type = types.nullOr types.str; - default = null; - }; - subPaths = mkOption { - type = types.attrsOf (types.submodule pathConfig); - default = {}; - }; - }; - }; - pathList = pathAttrsToListRec cfg "" {}; -in rec { - options = { - createPaths = mkOption { - type = types.attrsOf (types.submodule { - options = { - group = mkOption { - type = types.nullOr types.str; - default = null; - }; - owner = mkOption { - type = types.nullOr types.str; - default = null; - }; - permissions = mkOption { - type = types.nullOr types.str; - default = null; - }; - subPaths = mkOption { - type = types.attrsOf (types.submodule pathConfig); - default = {}; - description = '' - SubPaths to create using systemd tmpfiles. - ''; - }; - }; - }); - default = {}; - description = '' - Paths to create using systemd tmpfiles. - ''; - }; - }; - - config = mkIf (cfg != {}) { - systemd.tmpfiles.rules = - map - (dir: "d ${dir.path} ${dir.permissions} ${dir.owner} ${dir.group}") - pathList; - - users = let - extraGroups = map (path: path.group) pathList; - in { - groups = genAttrs extraGroups (group: {}); - }; - }; -} |
