Oh, I didn’t see that module line. I tried many things and I forgot to delete it, but it doesn’t make any difference.
I don’t exactly know why I need that line pkgs = import nixpkgs;, I added it to satisfy nix’ complain, this is the output of “home-manager switch” without that line.
[jeansib@dell-3:~/.config/home-manager]$ home-manager switch --verbose --show-trace
error:
… from call site
at /nix/store/srcwbp6pcscp4d5551djisbfiy6vlm5n-source/flake.nix:28:29:
27| homeConfigurations = {
28| "jeansib" = home-manager.lib.homeManagerConfiguration {
| ^
29| extraSpecialArgs = {
error: function 'homeManagerConfiguration' called without required argument 'pkgs'
at /nix/store/alm3nymx19kvkc8my31niws5d81b9pri-source/flake.nix:41:36:
40| hm = (import ./modules/lib/stdlib-extended.nix nixpkgs.lib).hm;
41| homeManagerConfiguration = { modules ? [ ], pkgs, lib ? pkgs.lib
| ^
42| , extraSpecialArgs ? { }, check ? true
[jeansib@dell-3:~/.config/home-manager]$
I want to have two options in installing software: I want to be able to install some packages from unstable branch, and some from stable. How do I implement it to my home.nix file?
You need a pkgs attrset in the home manager configuration. Therefore, you need to move the stable (your default package set, if by default you want stable packages) from extraSpecialArgs to where pkgs previously have been, but also correctly set it to the result of a function:
pkgs = import nixpkgs-24-11 { inherit system; };
# Or like this:
pkgs = nixpkgs-24-11.legacyPackages.${system};
Then you use pkgs.firefox to install the stable Firefox version and pkgs-unstable.firefox to install the unstable version.