nixdots/home/impermanence/default.nix

48 lines
1 KiB
Nix
Raw Normal View History

2024-06-19 15:41:40 +00:00
{
lib,
osConfig,
inputs,
...
}: let
inherit (lib) mkIf;
cfg = osConfig.myOptions.system.impermanence.home;
in {
2024-07-26 23:07:07 +00:00
imports = [inputs.impermanence.nixosModules.home-manager.impermanence];
2024-06-19 15:41:40 +00:00
config = mkIf cfg.enable {
home.persistence."${cfg.persistentMountPoint}" = {
2024-07-26 23:07:07 +00:00
directories =
[
".cache/nix"
".cache/nix-index"
]
++ cfg.extraDirectories;
files =
[
]
++ cfg.extraFiles;
2024-06-19 15:41:40 +00:00
# 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;
};
home.persistence."${cfg.persistentDataMountPoint}" = {
2024-07-26 23:07:07 +00:00
directories =
[
]
++ cfg.extraDataDirectories;
files =
[
]
++ cfg.extraDataFiles;
# See comment for this above
allowOther = true;
};
2024-06-19 15:41:40 +00:00
};
}