summaryrefslogtreecommitdiff
path: root/modules/xnet/persist.nix
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2026-10-03 19:56:13 -0700
committerKleidi Bujari <mail@4kb.net>2026-10-03 20:59:26 -0700
commit0d15a4d19f7925be328c2d24214a11e5ac541c40 (patch)
treeff75c552989cec4651f941126628a3702f6c6bcf /modules/xnet/persist.nix
parent16918d62b34b7e4d7817837057b88acb44e4f63c (diff)
downloaddepot-0d15a4d19f7925be328c2d24214a11e5ac541c40.tar.gz
depot-0d15a4d19f7925be328c2d24214a11e5ac541c40.tar.bz2
depot-0d15a4d19f7925be328c2d24214a11e5ac541c40.zip
nixfmt formatting pass
Diffstat (limited to 'modules/xnet/persist.nix')
-rw-r--r--modules/xnet/persist.nix59
1 files changed, 33 insertions, 26 deletions
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