From c9495ea8812b8f3c23e7ae13492a8199bb42a1d9 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Mon, 13 Jul 2020 20:00:47 -0600 Subject: [PATCH] direnv: use `nix print-dev-env` In order to increase determinism in the build environment, we are having direnv load the shell environment from the flake's `devShell` output, instead of the traditional `nix-shell` approach. Of course, one can still enter a `nix-shell` manually on a system without flake support installed. --- .envrc | 6 +++++- flake.nix | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.envrc b/.envrc index 1d953f4..261d630 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,5 @@ -use nix +# reload when these files change +watch_file flake.nix +watch_file flake.lock +# load the flake devShell +eval "$(nix print-dev-env)" diff --git a/flake.nix b/flake.nix index 7c4fde4..f6a54e9 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,8 @@ import ./hosts (inputs // { inherit system pkgs unstablePkgs; }); in configs; + devShell."${system}" = import ./shell.nix { inherit pkgs; }; + overlay = import ./pkgs; overlays = let