forked from direnv/direnv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
39 lines (33 loc) · 842 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ pkgs ? import ./nix { } }:
let
inherit (pkgs)
bash
buildGoModule
lib
stdenv
;
in
buildGoModule rec {
name = "direnv-${version}";
version = lib.fileContents ./version.txt;
subPackages = [ "." ];
vendorSha256 = "sha256-eQaQ77pOYC8q+IA26ArEhHQ0DCU093TbzaYhdV3UydE=";
src = builtins.fetchGit ./.;
# we have no bash at the moment for windows
BASH_PATH =
lib.optionalString (!stdenv.hostPlatform.isWindows)
"${bash}/bin/bash";
# replace the build phase to use the GNUMakefile instead
buildPhase = ''
make BASH_PATH=$BASH_PATH
'';
installPhase = ''
make install PREFIX=$out
'';
meta = {
description = "A shell extension that manages your environment";
homepage = https://direnv.net;
license = lib.licenses.mit;
maintainers = [ lib.maintainers.zimbatm ];
};
}