diff options
| author | Kleidi Bujari <mail@4kb.net> | 2025-04-02 22:11:38 -0400 |
|---|---|---|
| committer | Kleidi Bujari <mail@4kb.net> | 2025-04-02 22:11:38 -0400 |
| commit | c950f338c5720a132552863a35d1c7924df3d3a6 (patch) | |
| tree | c3134c42e1618c255ca8e9e0698f90b0ae8b3563 /machines/xnet/persist.nix | |
| parent | b619ff9dd42eaa62569c8297142f0e4c719d40d2 (diff) | |
| parent | 09c2b6de63a6ff35348fcb2c2eb57b974f0a8a52 (diff) | |
| download | depot-c950f338c5720a132552863a35d1c7924df3d3a6.tar.gz depot-c950f338c5720a132552863a35d1c7924df3d3a6.tar.bz2 depot-c950f338c5720a132552863a35d1c7924df3d3a6.zip | |
Merge remote-tracking branch 'origin/copy-blueprint'
Diffstat (limited to 'machines/xnet/persist.nix')
| -rw-r--r-- | machines/xnet/persist.nix | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/machines/xnet/persist.nix b/machines/xnet/persist.nix deleted file mode 100644 index 10eb883..0000000 --- a/machines/xnet/persist.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ config, lib, ... }: -let - inherit (lib) - concatLists - isString - mkOption - types - ; - -in -{ - options.xnet.persist = mkOption { - type = types.listOf (types.either - types.str - (types.submodule { - options = { - path = mkOption { - type = types.str; - description = "Path to persist"; - }; - user = mkOption { - type = types.nullOr types.str; - default = null; - description = "User ID to set on the persisted directory"; - }; - group = mkOption { - type = types.nullOr types.str; - default = null; - description = "Group ID to set on the persisted directory"; - }; - - mode = mkOption { - type = types.nullOr types.str; - default = null; - description = "Permissions to set"; - }; - }; - })); - default = [ ]; - description = "Automatically persisted state."; - }; - - config.systemd.tmpfiles.rules = - let - mkEntry = entry: - let - path = if isString entry then entry else entry.path; - user = if isString entry then "-" else entry.user; - group = if isString entry then "-" else entry.group; - mode = if isString entry then "-" else entry.mode; - - dent = "d /persist${path} ${mode} ${user} ${group} - -"; - link = "L+ ${path} - - - - /persist${path}"; - perm = "Z ${mode} ${user} ${group} - -"; - in - [ dent link perm ]; - - entries = map mkEntry config.xnet.persist; - in - concatLists entries; -} |
