summaryrefslogtreecommitdiffstats
path: root/modules/by-name/im/impermanence/module.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-31 10:21:40 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-31 10:21:40 +0100
commit2ccbdd3242dd58df81de738a3c538cf68ba51c95 (patch)
tree3d3c6cad924e73d9a498ca6039643534858389eb /modules/by-name/im/impermanence/module.nix
parent{modules,treefmt}: Align last files with the server repository (diff)
downloadnixos-config-2ccbdd3242dd58df81de738a3c538cf68ba51c95.zip
treewide: Align modules with server directory
Diffstat (limited to 'modules/by-name/im/impermanence/module.nix')
-rw-r--r--modules/by-name/im/impermanence/module.nix49
1 files changed, 17 insertions, 32 deletions
diff --git a/modules/by-name/im/impermanence/module.nix b/modules/by-name/im/impermanence/module.nix
index 43943363..be3bacdc 100644
--- a/modules/by-name/im/impermanence/module.nix
+++ b/modules/by-name/im/impermanence/module.nix
@@ -13,9 +13,15 @@
modules,
...
}: let
- cfg = config.soispha.impermanence;
+ cfg = config.vhack.impermanence;
+
+ userDirectories = lib.debug.traceValSeqN 2 (lib.mapAttrs (_: dirs: {
+ directories =
+ dirs;
+ })
+ cfg.userDirectories);
in {
- options.soispha.impermanence = {
+ options.vhack.impermanence = {
enable = lib.mkEnableOption "persisting directories and files with impermanence";
directories = lib.mkOption {
@@ -33,7 +39,7 @@ in {
};
userDirectories = lib.mkOption {
- type = lib.types.listOf (lib.types.either lib.types.str (lib.types.submodule {
+ type = lib.attrsOf lib.types.listOf (lib.types.either lib.types.str (lib.types.submodule {
options = {
directory = lib.mkOption {
type = lib.types.str;
@@ -44,7 +50,7 @@ in {
};
}));
default = [];
- description = "The directories to persist";
+ description = "The directories to persist, for each user.";
};
};
@@ -53,36 +59,15 @@ in {
];
config = lib.mkIf cfg.enable {
- environment.persistence = {
- "/srv" = {
- hideMounts = true;
- inherit (cfg) directories;
-
- users.soispha = {
- directories =
- [
- # TODO: These should all be moved to their respective modules <2024-12-08>
- ".local/share"
+ environment.persistence."/srv" = {
+ hideMounts = true;
+ inherit (cfg) directories;
- ".local/state/nvim"
- ".local/state/mpv"
- ".local/state/wireplumber"
-
- ".config/Signal"
-
- ".cache"
-
- "media"
- "repos"
- "documents"
- ]
- ++ cfg.userDirectories;
- };
+ users = userDirectories;
- files = [
- "/etc/machine-id"
- ];
- };
+ files = [
+ "/etc/machine-id"
+ ];
};
};
}