I have a problem with mixing unstable, stable & home-manager that I cannot figure out. Any help would really be appreciated.
I am trying to use helix
in its newest version (23.10) instead of the previous (23.05). This works for root, but not for non-root:
$ hx --version
helix 23.05
$ sudo -i
# hx --version
helix 23.10 (f6021dd0)
which is what is expected with the follwing configuration (3 files following):
I bring in home-manager and unstable like this:
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager
sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixos-unstable
sudo nix-channel --update
My /etc/nixos/configuration.nix
is essentially this:
{ pkgs, ...}:
let
unstable = import <nixos-unstable> {};
in {
imports = [
./hardware-configuration.nix
<home-manager/nixos>
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = [
unstable.helix
pkgs.zsh
];
users.users.jps = {
# ...
};
home-manager = {
extraSpecialArgs = { inherit unstable; };
useGlobalPkgs = false;
useUserPackages = true;
users.jps = import ./home.nix;
};
system.stateVersion = "23.05";
The home.nix
is essentially
{ config, pkgs, unstable, ... }:
{
imports = [
./helix.nix
];
home = {
stateVersion = "23.05";
sessionVariables = {
EDITOR = "hx";
};
packages = [
pkgs.helix
pkgs.zsh
];
# ...
};
}
and helix.nix
is just including a configuration file:
{
programs.helix.enable = true;
xdg.configFile."helix/config.toml".source = ../common/helix/config.toml;
}
Now, if I try to use the helix package from unstable (like root does) by changing home.nix
to
packages = [
unstable.helix
pkgs.zsh
];
then I get a collision:
error: collision between `/nix/store/nayfcdjkl4d1n5w5c0n72np99zvy9x3m-helix-23.10/bin/.hx-wrapped' and `/nix/store/1g9pz0sc47y6v3q7ya6mik0gj37vjiay-helix-23.05/bin/.hx-wrapped'
Why is that?