diff options
author | Alan Pearce | 2023-04-11 15:12:03 +0200 |
---|---|---|
committer | Alan Pearce | 2023-04-11 15:12:03 +0200 |
commit | d2711022cde38d2e0035edd917d7f17f2b7c9ff2 (patch) | |
tree | 167ad4754f3b8c169cd5a0afc041ac4e5050cb14 /user/settings/development | |
parent | aa43b171944d5393f23e6e2902ceb7191714ab03 (diff) | |
download | nixfiles-d2711022cde38d2e0035edd917d7f17f2b7c9ff2.tar.lz nixfiles-d2711022cde38d2e0035edd917d7f17f2b7c9ff2.tar.zst nixfiles-d2711022cde38d2e0035edd917d7f17f2b7c9ff2.zip |
Enable automatic per-project nix development shells with direnv
Diffstat (limited to 'user/settings/development')
-rw-r--r-- | user/settings/development/base.nix | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/user/settings/development/base.nix b/user/settings/development/base.nix index a1ebca38..9de20fc4 100644 --- a/user/settings/development/base.nix +++ b/user/settings/development/base.nix @@ -2,7 +2,13 @@ , lib , pkgs , ... -}: { +}: +let + direnvHook = pkgs.runCommandLocal "direnv_hook" { } '' + ${pkgs.direnv}/bin/direnv hook zsh > $out + ''; +in +{ home.packages = with pkgs; [ shellcheck @@ -31,4 +37,14 @@ ripgrep = super.ripgrep.override { withPCRE2 = true; }; }) ]; + + programs.direnv = { + enable = true; + nix-direnv = { + enable = true; + }; + }; + programs.zsh.initExtra = '' + source ${direnvHook} + ''; } |