Disable home impermanence
This commit is contained in:
@@ -7,10 +7,34 @@ let
|
||||
in {
|
||||
options = {
|
||||
sydnix.impermanence = {
|
||||
enable = mkOption {
|
||||
description = "Enable Impermanence";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
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 {
|
||||
@@ -28,10 +52,22 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.persistence."/persist/home/${config.home.username}" = {
|
||||
allowOther = true;
|
||||
directories = cfg.directories;
|
||||
files = cfg.files;
|
||||
};
|
||||
home.persistence = {
|
||||
"/persist/home/${config.home.username}" = {
|
||||
allowOther = true;
|
||||
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;
|
||||
};
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user