summary refs log tree commit diff stats
path: root/user/settings/development
diff options
context:
space:
mode:
authorAlan Pearce2024-04-28 09:09:41 +0200
committerAlan Pearce2024-04-28 09:09:41 +0200
commit7b1b023f4a7894e8df5aae1c1f76c1d88c0f198a (patch)
tree8b4424476e1fab6e4f9a734b838e34961fef3e55 /user/settings/development
parentd42ee8edeb7983ca7031a334c8f6c36f9c102595 (diff)
downloadnixfiles-7b1b023f4a7894e8df5aae1c1f76c1d88c0f198a.tar.lz
nixfiles-7b1b023f4a7894e8df5aae1c1f76c1d88c0f198a.tar.zst
nixfiles-7b1b023f4a7894e8df5aae1c1f76c1d88c0f198a.zip
dev/base: don't overwrite direnvrc (contains nix-direnv include)
Diffstat (limited to 'user/settings/development')
-rw-r--r--user/settings/development/base.nix20
1 files changed, 10 insertions, 10 deletions
diff --git a/user/settings/development/base.nix b/user/settings/development/base.nix
index e86a0b6e..4c0f2eb7 100644
--- a/user/settings/development/base.nix
+++ b/user/settings/development/base.nix
@@ -72,15 +72,15 @@
         ];
       };
     };
+    stdlib = ''
+      declare -A direnv_layout_dirs
+      direnv_layout_dir() {
+        echo "''${direnv_layout_dirs[$PWD]:=$(
+          local hash="$(${pkgs.coreutils}/bin/sha256sum - <<<"''${PWD}" | cut -c-7)"
+      		local path="''${PWD//[^a-zA-Z0-9]/-}"
+          echo "${config.xdg.cacheHome}/direnv/layouts/''${hash}''${path}"
+        )}"
+      }
+    '';
   };
-  xdg.configFile."direnv/direnvrc".text = ''
-    declare -A direnv_layout_dirs
-    direnv_layout_dir() {
-      echo "''${direnv_layout_dirs[$PWD]:=$(
-        local hash="$(${pkgs.coreutils}/bin/sha256sum - <<<"''${PWD}" | cut -c-7)"
-    		local path="''${PWD//[^a-zA-Z0-9]/-}"
-        echo "${config.xdg.cacheHome}/direnv/layouts/''${hash}''${path}"
-      )}"
-    }
-  '';
 }