From 32ca87e3a60b34940b7a6e8a3c3295a4f29505ad Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 4 Sep 2023 22:02:05 +0200 Subject: [PATCH] fix: wrong nvidia enable path in home-manager impermanence passthrough; and impermanence requires root home directory to be set separately --- modules/config/impermanence.nix | 2 +- users/common/impermanence.nix | 7 +++++-- users/root/default.nix | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/config/impermanence.nix b/modules/config/impermanence.nix index 6f6bf56..a9a9d79 100644 --- a/modules/config/impermanence.nix +++ b/modules/config/impermanence.nix @@ -49,7 +49,7 @@ in { # persistence options that we defined above. imports = let mkUserFiles = map (x: - {mode = "600";} + {parentDirectory.mode = "700";} // ( if isAttrs x then x diff --git a/users/common/impermanence.nix b/users/common/impermanence.nix index 392f97f..e7d3af9 100644 --- a/users/common/impermanence.nix +++ b/users/common/impermanence.nix @@ -1,8 +1,11 @@ { config, nixosConfig, + lib, ... -}: { +}: let + inherit (lib) optionals; +in { home.persistence."/state".files = [ # nothing yet ... @@ -28,7 +31,7 @@ ".local/state/nvim" ".cache/nvim" ] - ++ optionals nixosConfig.hardware.nvidia.enable [ + ++ optionals nixosConfig.hardware.nvidia.modesetting.enable [ ".cache/nvidia" # GLCache ] ++ optionals nixosConfig.services.pipewire.enable [ diff --git a/users/root/default.nix b/users/root/default.nix index a64cfaf..01d07ec 100644 --- a/users/root/default.nix +++ b/users/root/default.nix @@ -1,6 +1,5 @@ { config, - lib, pkgs, ... }: { @@ -10,6 +9,10 @@ shell = pkgs.zsh; }; + # This cannot currently be derived automatically due to a design flaw in nixpkgs. + environment.persistence."/state".users.root.home = "/root"; + environment.persistence."/persist".users.root.home = "/root"; + home-manager.users.root = { imports = [ ../common