2024-06-19 15:41:40 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
osConfig,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib) mkIf;
|
|
|
|
cfg = osConfig.myOptions.system.impermanence.home;
|
|
|
|
in {
|
|
|
|
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.persistence."${cfg.persistentMountPoint}" = {
|
|
|
|
directories = [
|
|
|
|
".cache/nix"
|
2024-06-19 16:49:54 +00:00
|
|
|
".cache/nix-index"
|
2024-06-19 15:41:40 +00:00
|
|
|
] ++ cfg.extraDirectories;
|
|
|
|
|
|
|
|
files = [
|
|
|
|
|
|
|
|
] ++ cfg.extraFiles;
|
|
|
|
|
|
|
|
# Allow other users (such as root), to access files through the bind
|
|
|
|
# mounted directories listed in `directories`. Useful for `sudo` operations,
|
|
|
|
# Docker, etc. Requires NixOS configuration programs.fuse.userAllowOther = true;
|
|
|
|
allowOther = true;
|
|
|
|
};
|
2024-06-26 20:51:51 +00:00
|
|
|
|
|
|
|
home.persistence."${cfg.persistentDataMountPoint}" = {
|
|
|
|
directories = [
|
|
|
|
|
|
|
|
] ++ cfg.extraDataDirectories;
|
|
|
|
|
|
|
|
files = [
|
|
|
|
|
|
|
|
] ++ cfg.extraDataFiles;
|
|
|
|
|
|
|
|
# See comment for this above
|
|
|
|
allowOther = true;
|
|
|
|
};
|
2024-06-19 15:41:40 +00:00
|
|
|
};
|
|
|
|
}
|