From 0753aa59e9a238789f6c4701970ec1011c9d104f Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 22 Oct 2022 06:09:53 -0700 Subject: [PATCH] refactor: move default home impermanence dirs to `modules/universal/users.nix` --- modules/impermanence.nix | 13 +------------ modules/universal/users.nix | 10 ++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/impermanence.nix b/modules/impermanence.nix index 47a21a5f..f4d562c2 100644 --- a/modules/impermanence.nix +++ b/modules/impermanence.nix @@ -38,18 +38,7 @@ in in mkIf cfg.enable { sane.image.extraDirectories = [ "/nix/persist/var/log" ]; environment.persistence."/nix/persist" = { - directories = (map-home-dirs ([ - # cache is probably too big to fit on the tmpfs - # TODO: we could bind-mount it to something which gets cleared per boot, though. - ".cache" - ".cargo" - ".rustup" - ".ssh" - ".local/share/keyrings" - # intentionally omitted: - # ".config" # managed by home-manager - # ".local" # nothing useful in here - ] ++ cfg.home-dirs)) ++ (map-sys-dirs [ + directories = (map-home-dirs cfg.home-dirs) ++ (map-sys-dirs [ # TODO: this `0700` here clobbers the perms for /persist/etc, breaking boot on freshly-deployed devices # { mode = "0700"; directory = "/etc/NetworkManager/system-connections"; } # "/etc/nixos" diff --git a/modules/universal/users.nix b/modules/universal/users.nix index 5e0ad8ed..e2985516 100644 --- a/modules/universal/users.nix +++ b/modules/universal/users.nix @@ -67,6 +67,16 @@ in }; }; + sane.impermanence.home-dirs = [ + # cache is probably too big to fit on the tmpfs + # TODO: we could bind-mount it to something which gets cleared per boot, though. + ".cache" + ".cargo" + ".rustup" + ".ssh" + ".local/share/keyrings" + ]; + sane.impermanence.service-dirs = mkIf cfg.guest.enable [ { user = "guest"; group = "users"; directory = "/home/guest"; } ];