I’d like to change nixpkgs to point to a local git checkout in /Computer/nixpkgs. I’m aware of the -I
option, which works great, but I’d like to set NIX_PATH so I don’t have to pass the flag every time. I found this thread: Supported way to set NIX_PATH, and the approach here is great, but unfortunately this completely clobbers other variables.
Right now, my solution is:
> echo $NIX_PATH
ssh-config-file=~/.ssh/config:ssh-config-file=~/.ssh/config:/home/tyler/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
> export NIX_PATH=${NIX_PATH/nixpkgs=\/nix\/var\/nix\/profiles\/per-user\/root\/channels\/nixos/nixpkgs=\/Computer\/nixpkgs}
> echo $NIX_PATH
ssh-config-file=~/.ssh/config:ssh-config-file=~/.ssh/config:/home/tyler/.nix-defexpr/channels:nixpkgs=/Computer/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
What’s the idiomatic way to do this in configuration.nix? Thanks!