Open quatquatt opened 3 weeks ago
Found the perfect solution here:
https://discourse.nixos.org/t/set-up-nixos-home-manager-via-flake/29710/3 https://github.com/nmasur/dotfiles/blob/master/flake.nix
It's some magic with config that I'll have to figure out, but this is huge.
There's a lot of abstraction in the example code with it being moved between files, so here's things brought into the same file for simplicity:
nixosConfigurations.tempest =
{
inputs.nixpkgs.lib.nixosSystem =
{
inherit system;
modules =
[
globals
inputs.home-manager.nixosModules.home-manager
];
};
};
homeConfigurations.tempest = nixosConfigurations.tempest.config.home-manager.users.${hostVars.username}.home;
Basically the nixosConfigurations declares the home-manager stuff so it's declarative, and then homeConfigurations steals from it for quick reinstalls.
I had to reinstall because I messed something up and couldn't revert a generation. I need some way to revert home-manager generations, with as few side effects as possible.
Options include:
Standalone (home-manager switch)
Module (sudo nixos-rebuild switch)