diff --git a/.envrc b/.envrc index 8dfc6aa7..77ce6204 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ +watch_file shell.nix use flake || use nix diff --git a/shell.nix b/shell.nix index 3d3f1512..18ea0e41 100644 --- a/shell.nix +++ b/shell.nix @@ -18,16 +18,17 @@ pkgs.mkShell { nativeBuildInputs = with pkgs; [ git git-crypt - nixFlakes rebuild ]; shellHook = '' mkdir -p secrets - PATH=${ - pkgs.writeShellScriptBin "nix" '' - ${pkgs.nixFlakes}/bin/nix --option experimental-features "nix-command flakes ca-references" "$@" - '' - }/bin:$PATH + if ! nix flake show; then + PATH=${ + pkgs.writeShellScriptBin "nix" '' + ${pkgs.nixFlakes}/bin/nix --option experimental-features "nix-command flakes ca-references" "$@" + '' + }/bin:$PATH + fi ''; }