I'm new to NixOs and trying to find my feet. I'd like to have a number of channels available in pkgs when importing it into various modules, so that I can pick and choose a bit. I'm using the approach described here:
https://nixos.wiki/wiki/Flakes#Importing_packages_from_multiple_channels, where a simple overlay is used to updated pkgs.
I've created this overlay in a channels.nix, which I'm then importing into my configuration.nix.
This works in that I can then use eg
environment.systemPackages = with pkgs; [
vim
unstable.xterm
]
Where unstable is one of the channels I have defined in channels.nix, which is exactly as intended.
I then tried the same thing in my home.nix, eg
home.packages = with pkgs; [
any-nix-shell
unstable.alacritty
]
Which does not work - nix does not recognize unstable as being a valid attribute. So do I need to specifically pass the updated pkgs to the imports = [ ./home.nix ] statement? The syntax for doing so seems slightly convoluted so this seems non-idiomatic.
I would have thought that lazy evaluation would have some bearing here, but it's not entirely obvious to me how.
Any help gratefully received.