-
Notifications
You must be signed in to change notification settings - Fork 4
/
default.nix
54 lines (45 loc) · 1.28 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
let
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/893186f4fd4c1e697b2bc38aa8f268f236d5ea02.tar.gz";
}) {};
stdenv = pkgs.stdenv;
ruby = (pkgs.ruby_2_3_0.override { cursesSupport = true; });
unstable = builtins.tryEval ( import <unstable> {} );
terraform = if unstable.success then
import (unstable.value.path + "/pkgs/applications/networking/cluster/terraform/") {
stdenv = unstable.value.stdenv;
lib = unstable.value.lib;
buildGoPackage = unstable.value.buildGoPackage;
fetchFromGitHub = unstable.value.fetchFromGitHub;
}
else
[];
in stdenv.mkDerivation rec {
name = "terrafying";
buildInputs = [
ruby
pkgs.libxml2
pkgs.libxslt
pkgs.zlib
pkgs.bzip2
pkgs.openssl
pkgs.readline
terraform
] ++ (pkgs.lib.optionals (!stdenv.isDarwin) [ pkgs.glibc ]);
src = ./.;
installPhase = ''
mkdir -p $out
cp -R $src/* $out
for i in `ls $out/bin`; do
chmod +x $out/bin
done
'';
shellHook = ''
export PKG_CONFIG_PATH=${pkgs.libxml2}/lib/pkgconfig:${pkgs.libxslt}/lib/pkgconfig:${pkgs.zlib}/lib/pkgconfig
# gems
mkdir -p .nix-gems
export GEM_HOME=$PWD/.nix-gems
export GEM_PATH=$GEM_HOME
export PATH=$GEM_HOME/bin:$PATH
'';
}