Add home impermanence

This commit is contained in:
ItsDrike 2024-06-19 17:41:40 +02:00
parent 6a16de8d16
commit 9dd5d40494
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
4 changed files with 93 additions and 1 deletions

View file

@ -0,0 +1,28 @@
{
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"
] ++ 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;
};
};
}