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.
This commit is contained in:
Timothy DeHerrera 2020-07-13 20:00:47 -06:00
parent b954963e36
commit c9495ea881
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
2 changed files with 7 additions and 1 deletions

6
.envrc
View file

@ -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)"

View file

@ -40,6 +40,8 @@
import ./hosts (inputs // { inherit system pkgs unstablePkgs; }); import ./hosts (inputs // { inherit system pkgs unstablePkgs; });
in configs; in configs;
devShell."${system}" = import ./shell.nix { inherit pkgs; };
overlay = import ./pkgs; overlay = import ./pkgs;
overlays = let overlays = let