-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
32 lines (29 loc) · 773 Bytes
/
default.nix
File metadata and controls
32 lines (29 loc) · 773 Bytes
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
with import <nixpkgs> {};
let
rstrip = s:
let
inherit (builtins) substring;
len = builtins.stringLength s;
suffix = substring (len - 1) 1 s;
ws = [ " " "\r" "\n" "\t" ];
in
if len > 0 && builtins.any (char: char == suffix) ws then
rstrip (substring 0 (len - 1) s)
else
s;
readVersion = f:
rstrip (builtins.readFile f);
in
buildGoPackage rec {
version = readVersion ./version.txt;
name = "direnv-${version}";
goPackagePath = "github.com/zimbatm/direnv";
src = ./.;
meta = with stdenv.lib; {
homepage = http://direnv.net;
description = "path-dependent environments";
maintainers = with maintainers; [ zimbatm ];
license = licenses.mit;
platforms = go.meta.platforms;
};
}