Djabx
June 11, 2022, 2:53pm
1
Hi everyone,
I’m new to nix but I choose to dive right in NixOs and not just nix-shell (from fedora).
I’m really interested in declarative configuration of my computer / home, so I want to use home-manager.
My system configuration is available here: https://gist.github.com/Djabx/0136c6a01eeb832fed70e0199df4f207
I really like it, but my main concern is that after each reboot of my computer I’ve to do:
$nix-shell -p home-manager --run 'cd .config/nixpkgs/ && home-manager build && home-manager switch'
Witch is a bit of pain at every boot, especially when I’ve no network…
Am’I doing something wrong in my configuration.nix that home-manager is not properly loaded at startup ?
Thanks for your time and answers.
Sandro
June 11, 2022, 5:01pm
2
Are you sourcing ~/.nix-profile/etc/profile.d/nix.sh
?
NobbZ
June 11, 2022, 5:07pm
3
That looks as if you are using HM as a module
https://gist.github.com/Djabx/0136c6a01eeb832fed70e0199df4f207#file-configuration-nix-L13-L14
If my assumption is true, then you should not use home-manager
CLI tool at all, but instead do all of your HM in the system configuration.
Djabx
June 11, 2022, 5:55pm
4
No, I do not, but I’m using fish not bash.
Djabx
June 11, 2022, 6:31pm
5
What I want is:
have the least package in “root”,
users manage all their packages with a config file (as I understand not nix-env), so they do not need to be root to add/remove package on their own.
So if I understand you well, I should remove the nixos module, and home-manager as a standalone module ?
Is it correct ?
Djabx
June 11, 2022, 6:40pm
6
Ok I’ve updated my gist with my new configuration.
Thank you @NobbZ it work much better now
Sandro
June 12, 2022, 12:57am
7
You want to source that file or the fish equivalent
Djabx
June 13, 2022, 6:53am
8
Ok, i’ve check and indeed, the fish default config file (~/.config/fish/config.fish
) is generated and init all needed informations.