Skip to content
Snippets Groups Projects
  • Tom Prince's avatar
    65fd0080
    Set `NIX_PATH` in `shellHook` of `shell.nix`. · 65fd0080
    Tom Prince authored
    If `nix-shell` is run interactively on NixOS, in way that has loaded
    `/etc/profile` (for example `docker exec <container> nix-shell`), then
    `/etc/profile` will be sourced in the shell that nix-shell starts. That
    overwrites the `NIX_PATH` set by `shell.nix`.
    
    If we instead set `NIX_PATH` in the the `shellHook`, that always takes
    precedence.
    65fd0080
    History
    Set `NIX_PATH` in `shellHook` of `shell.nix`.
    Tom Prince authored
    If `nix-shell` is run interactively on NixOS, in way that has loaded
    `/etc/profile` (for example `docker exec <container> nix-shell`), then
    `/etc/profile` will be sourced in the shell that nix-shell starts. That
    overwrites the `NIX_PATH` set by `shell.nix`.
    
    If we instead set `NIX_PATH` in the the `shellHook`, that always takes
    precedence.