diff options
Diffstat (limited to 'overlays/nix-direnv/default.nix')
| -rw-r--r-- | overlays/nix-direnv/default.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/overlays/nix-direnv/default.nix b/overlays/nix-direnv/default.nix new file mode 100644 index 00000000..7c488e4e --- /dev/null +++ b/overlays/nix-direnv/default.nix | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | { final, prev, ... }: { | ||
| 2 | nix-direnv = prev.resholve.mkDerivation rec { | ||
| 3 | pname = "nix-direnv"; | ||
| 4 | version = "3.0.6"; | ||
| 5 | |||
| 6 | patches = [ | ||
| 7 | ./static-nix.patch | ||
| 8 | ]; | ||
| 9 | |||
| 10 | src = prev.fetchFromGitHub { | ||
| 11 | owner = "nix-community"; | ||
| 12 | repo = "nix-direnv"; | ||
| 13 | rev = version; | ||
| 14 | hash = "sha256-oNqhPqgQT92yxbKmcgX4F3e2yTUPyXYG7b2xQm3TvQw="; | ||
| 15 | }; | ||
| 16 | |||
| 17 | installPhase = '' | ||
| 18 | runHook preInstall | ||
| 19 | install -m400 -D direnvrc $out/share/nix-direnv/direnvrc | ||
| 20 | runHook postInstall | ||
| 21 | ''; | ||
| 22 | |||
| 23 | solutions = { | ||
| 24 | default = { | ||
| 25 | scripts = [ "share/nix-direnv/direnvrc" ]; | ||
| 26 | interpreter = "none"; | ||
| 27 | inputs = with final; [ coreutils nix-monitored ]; | ||
| 28 | fake = { | ||
| 29 | builtin = [ | ||
| 30 | "PATH_add" | ||
| 31 | "direnv_layout_dir" | ||
| 32 | "has" | ||
| 33 | "log_error" | ||
| 34 | "log_status" | ||
| 35 | "watch_file" | ||
| 36 | ]; | ||
| 37 | function = [ | ||
| 38 | # not really a function - this is in an else branch for macOS/homebrew that | ||
| 39 | # cannot be reached when built with nix | ||
| 40 | "shasum" | ||
| 41 | ]; | ||
| 42 | }; | ||
| 43 | keep = { | ||
| 44 | "$cmd" = true; | ||
| 45 | "$direnv" = true; | ||
| 46 | }; | ||
| 47 | execer = [ | ||
| 48 | "cannot:${prev.lib.getExe' final.nix-monitored "nix"}" | ||
| 49 | ]; | ||
| 50 | }; | ||
| 51 | }; | ||
| 52 | }; | ||
| 53 | } | ||
