feat: Impermanence (home)

This commit is contained in:
Madeleine Sydney
2025-01-01 19:23:58 -07:00
parent 9516c35c7f
commit 00402bdb93
7 changed files with 52 additions and 70 deletions

View File

@@ -9,44 +9,14 @@ in {
sydnix.impermanence = {
enable = mkEnableOption "impermanence";
mutableDotfiles = {
enable = mkEnableOption "dotfiles under impermanence";
# storeAt = mkOption {
# default = "dots/config";
# type = types.str;
# # type = with types;
# # addCheck
# # path
# # (x: cfg.mutableDotfiles.enable
# # -> ! (elem x cfg.mutableDotfiles.directories));
# };
files = mkOption {
default = [];
# FIXME: Inaccurate type.
type = with types;
listOf anything;
};
directories = mkOption {
default = [];
# FIXME: Inaccurate type.
type = with types;
listOf anything;
};
};
directories = mkOption {
# type = with types;
# listOf (coercedTo str (d: { directory = d; }) userDir);
default = [];
type = types.listOf types.anything;
};
files = mkOption {
# type = with types;
# listOf (coercedTo str (f: { file = f; }) userFile);
default = [];
type = types.listOf types.anything;
};
};
};
@@ -58,16 +28,6 @@ in {
directories = cfg.directories;
files = cfg.files;
};
} // (if ! cfg.mutableDotfiles.enable
then {}
else {
"/persist/dots/users/${config.home.username}/dots/" = {
removePrefixDirectory = true;
directories = cfg.mutableDotfiles.directories;
files = cfg.mutableDotfiles.files;
allowOther = true;
};
});
};
};
}