Closed rapenne-s closed 2 years ago
I solved my issue, by re-reading the documentation and understanding my flake.nix file, it became clear the home.persistence.path
had to be under the home-manager
configuration, I was also lacking how to import home-manager.nix
from the impermanence flake, I found the syntax.
Here is my working flake.nix
file using impermanence and home-manager extension.
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, impermanence, home-manager, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; config = { allowUnfree = true; }; };
lib = nixpkgs.lib;
in
{
# begin nixosConfigurations
nixosConfigurations = {
t470 = lib.nixosSystem {
inherit system;
inherit lib;
specialArgs = { inherit inputs; };
# begin modules
modules = [
(import ./configuration.nix)
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.solene = {
home.username = "solene";
home.homeDirectory = "/home/solene";
imports = [ (inputs.impermanence + "/home-manager.nix") ];
home.persistence."/nix/home/solene" = {
allowOther = true;
removePrefixDirectory = false;
directories = [
".gnupg"
".ssh"
];
files = [
".config/mpv/mpv.conf"
".gitconfig"
".tmux.conf"
];
}; # end home.persistence
};
}
impermanence.nixosModules.impermanence
{
environment.persistence."/nix/" = {
directories = [
"/etc/NetworkManager/system-connections/"
"/etc/nixos"
"/home/aria"
"/home/jeux"
"/home/baptiste"
"/nix/var/nix"
"/root"
"/var/lib"
"/var/log"
"/tmp"
];
};
environment.etc."machine-id".source = "/nix/etc/machine-id";
}
];
};
};
};
}
Hi,
I'm trying to switch my configuration by using a flake, everything work so far except impermanence and its home-manager module.
I get this error
when using the following configuration
I tried to look at the issues and PR but I really don't understand how the
home.persistence
is supposed to work in this situation. I'd appreciate hints or help to get it to work.