Skip to content

Commit

Permalink
dev shell: add nixos-config to NIX_PATH
Browse files Browse the repository at this point in the history
Makes inspecting the system to be built from a local checkout with nix repl easier.
Inspecting the system still needs root permissions, though, because ENC
files in /etc/nixos/ are not accessible by normal users.
  • Loading branch information
dpausp committed Jun 7, 2022
1 parent 0524a52 commit b8397ca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ let
":"
(lib.mapAttrsToList (name: channel: "${name}=${channel}") channels);

nixosRepl = pkgs.writeShellScriptBin "nixos-repl" "nix repl nixos-repl.nix";

in pkgs.mkShell {
name = "fc-nixos";
NIX_PATH="fc=${toString ./.}:${nixPathUpstreams}";
NIX_PATH="fc=${toString ./.}:${nixPathUpstreams}:nixos-config=/etc/nixos/configuration.nix";
shellHook = ''
export PATH=$PATH:${nixosRepl}/bin
'';
}

0 comments on commit b8397ca

Please sign in to comment.