-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
users: Initial home-manager only configurations(non-nixos systems) #93
Conversation
I haven't had a lot of free time this month, but I'll be glad to test this out as soon as I've got a minute. Shouldn't be too difficult to work out the kinks. |
Yeah of course take your time, thanks for responding. I'll try to keep working through the bugs and implementing a few other things. I think overlays aren't currently added to the pkgs passed into home-manager and the flake registry and nix path can be set through home manager. I also have one question, I put the code in default.nix in the users folder, but it directly uses nixosConfigurations, so it doesn't actually use any of the user files. Does it make sense to have it there? I was thinking it could go in utils. |
397742e
to
79f41cd
Compare
So this turned out to be a lot simpler than I thought, apparently you can just use config.home-manager.users.[username].home.activationPackage to build the hm configuration. I also appended the homeConfiguration activationPackages to the packages output as hmActivationPackages so you can just build and debug with ./#hmActivationPackages.[host].[user] I think this is a pretty much complete and fairly simple implementation of this. There are a couple things left to do and I'll add that to the main post. |
79f41cd
to
5d881c0
Compare
for non-root users or non-nixos systems
Just pushed a rebase PR to your branch to fix the merge issues. |
48271d2
to
b1734b4
Compare
Alright thanks for doing the rebase! I think I merged it right, I just force pushed you're exact branch to mine |
Only minor issue left when running
I think we can resolve this later though as it doesn't actually affect functionality. |
Ohh interesting. How does it work in nixpkgs, since that has subsets of packages like pythonPackages? Or is pythonPackages a derivation itself somehow? |
Right now, nixpkgs doesn't even use the |
Ohh that makes sense |
Closes #83
Working implementation of exporting home-manager only configurations. This exports to a non-official output of homeConfigurations, along with hmActivationPackages in the packages output. Both are an attrset of hosts then users
So if you were trying to build activationPackage for the host NixOS and user nixos, you can do:
nix build ./#homeConfigurations.NixOS.nixos.home.activationPackage
or
`nix-build ./#hmActivation.NixOS.nixos'
This ones easier for debugging, because nix build will default to the packages output if homeConfiguration has any error and it won't say when it does so.
The flk script can then use the activation package to activate the home-manager configuration(not implemented yet).
There are a few more things to add like local nix registry and config with xdg.configFile along with nix paths and other compatibility things.
TODO:
- [ ] Add some default modules/imports to all the homeConfigurations, preferably only in homeConfigurations and not for system configs. Not sure if this is even possible yet. This can include: nix paths, local nix.conf, and others in the future.I think this can be done in the future, possibly along with adding custom modules feature to home-manager.