From 0d15a4d19f7925be328c2d24214a11e5ac541c40 Mon Sep 17 00:00:00 2001 From: Kleidi Bujari Date: Sat, 3 Oct 2026 19:56:13 -0700 Subject: nixfmt formatting pass --- modules/xnet/persist.nix | 59 +++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 26 deletions(-) (limited to 'modules/xnet/persist.nix') diff --git a/modules/xnet/persist.nix b/modules/xnet/persist.nix index 10eb883..5e69bae 100644 --- a/modules/xnet/persist.nix +++ b/modules/xnet/persist.nix @@ -10,39 +10,42 @@ let 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"; - }; + 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"; + 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: + mkEntry = + entry: let path = if isString entry then entry else entry.path; user = if isString entry then "-" else entry.user; @@ -53,7 +56,11 @@ in link = "L+ ${path} - - - - /persist${path}"; perm = "Z ${mode} ${user} ${group} - -"; in - [ dent link perm ]; + [ + dent + link + perm + ]; entries = map mkEntry config.xnet.persist; in -- cgit v1.3.1