diff options
| author | spl3g <spleefer6@yandex.ru> | 2025-10-27 23:33:33 +0300 |
|---|---|---|
| committer | spl3g <spleefer6@yandex.ru> | 2025-10-27 23:33:33 +0300 |
| commit | e6f739deb5369556f2895b523ffa1b02b74c60b1 (patch) | |
| tree | 3a3f0a983b3452b1573f894eb6c3319e17edad84 /nixos/serverModules/files.nix | |
| parent | 7c6e3be17875286d25a8ec2a2ad7c71c56258250 (diff) | |
feat: rewrite files to be more generic
Diffstat (limited to 'nixos/serverModules/files.nix')
| -rw-r--r-- | nixos/serverModules/files.nix | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/nixos/serverModules/files.nix b/nixos/serverModules/files.nix deleted file mode 100644 index 037d149..0000000 --- a/nixos/serverModules/files.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ config, lib, ... }: -with lib; -let - cfg = config.filesDir; -in -{ - options = { - filesDir = { - enable = mkEnableOption "Enable the creation of a main files directory and nfs binds for it."; - mainDir = mkOption { - type = types.str; - default = "/srv/files"; - description = '' - The main file dir. - ''; - }; - subPaths = mkOption { - type = types.listOf (types.submodule { - options = { - path = mkOption { - type = types.str; - }; - - group = mkOption { - type = types.str; - }; - }; - }); - default = []; - description = '' - Subpaths to create under the files dir. - ''; - }; - }; - }; - - config = mkIf cfg.enable { - systemd.tmpfiles.rules = [ - "d ${cfg.mainDir} 0770 files files" - ] ++ (map (dir: "d ${cfg.mainDir}/${dir.path} 0770 files ${dir.group}") cfg.subPaths); - - users = - let - extraGroups = (map (dir: dir.group) cfg.subPaths); - in { - groups = { - files = {}; - } // genAttrs extraGroups (group: {}); - - users.files = { - isNormalUser = true; - group = "files"; - home = cfg.mainDir; - homeMode = "770"; - inherit extraGroups; - }; - }; - }; -} |
