nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.18k stars 85 forks source link

Added home manager module to flake.nix #43

Closed RiscadoA closed 2 years ago

RiscadoA commented 3 years ago

home-manager.nix wasn't being added to nixosModules on flake.nix. Added it as impermanence-home.

lovesegfault commented 3 years ago

Couple thoughts:

cc. @talyz

talyz commented 3 years ago

I can't really comment on whether this works, since I don't use flakes, but it looks fine to me. home-manager.impermanence looks good.

Misterio77 commented 3 years ago

Been using this one for a while, working nicely so far

RiscadoA commented 3 years ago

Couple thoughts:

* Nix style is camelCase, so it should be `impermanenceHome`

* I wonder if we just want to have it be in a sub-attr, so `home-manager.impermanence`.

cc. @talyz

I've changed it to match your suggestions.

bnjmnt4n commented 3 years ago

I believe the home-manager community was working on standardizing this over at https://github.com/nix-community/home-manager/issues/1783, although it seems to have stalled.

a12l commented 2 years ago

How do I add this to my NixOS configuration flake? I've defined inputs.impermanence.url = "github:a12l/impermanence/master"; (my fork of nix-community/impermanence with this patch applied), and added

home-manager.nixosModules.home-manager
{
  home-manager.users.a12l = {
    imports = [ impermanence ];
    home.persistence."/persistent/home/a12l" = { };
  }
}

to my NixOS configuration flake. But when I try to build it I get

$ nixos-rebuild build --flake '.#mobile-p-ep1'
building the system configuration...
error: The option `home-manager.users.a12l.home.persistence' does not exist. Definition values:
       - In `/nix/store/480mp97jl7s8qy7m4plnq2v98qfzapma-source/flake.nix':
           {
             "/persistent/home/a12l" = { };
           }
(use '--show-trace' to show detailed location information)