summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--system/settings/darwin.nix2
-rw-r--r--user/settings/development/base.nix18
2 files changed, 19 insertions, 1 deletions
diff --git a/system/settings/darwin.nix b/system/settings/darwin.nix
index 9a61aa01..6b6f3aae 100644
--- a/system/settings/darwin.nix
+++ b/system/settings/darwin.nix
@@ -18,6 +18,8 @@
     settings.extra-platforms = "aarch64-darwin x86_64-darwin";
     settings.experimental-features = "nix-command flakes";
     settings.warn-dirty = false;
+    settings.keep-outputs = true;
+    settings.keep-derivations = true;
   };
 
   nixpkgs.config = {
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}
+  '';
 }