From f0447a81cc5bd6a00ac3e42da4b2177f9fc677aa Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Fri, 21 Jun 2024 05:17:12 +0200 Subject: [PATCH] feat(pkg): setup direnv for automatic directory environments --- home.nix | 8 ++++++++ nixos/configuration.nix | 5 +++++ programs/git.nix | 3 +++ 3 files changed, 16 insertions(+) diff --git a/home.nix b/home.nix index 7687de5..e4a91fb 100644 --- a/home.nix +++ b/home.nix @@ -39,6 +39,14 @@ }; }; + # https://github.com/nix-community/nix-direnv/ + programs.direnv = + { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; + services.unclutter.enable = true; services.gpg-agent.enable = true; services.blueman-applet.enable = true; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 91eccf8..e039fbb 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -122,6 +122,11 @@ # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. # networking.firewall.enable = false; + # https://github.com/nix-community/nix-direnv/ + nix.extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/programs/git.nix b/programs/git.nix index 4549bfc..f0cbb7b 100644 --- a/programs/git.nix +++ b/programs/git.nix @@ -25,6 +25,9 @@ ".watsonrc" ".idea" ".vscode" + "shell.nix" + ".envrc" + ".direnv" ]; # see https://github.com/dandavison/delta#get-started