blob: b56d754a9e59da0aebd5f6cf5beb3b720110c1ff [file] [log] [blame]
Serge Bazanskic97461e2021-02-17 20:29:48 +01001# Shell for being able to use bazel on NixOS (or on any operating system with Nix installed).
2
3let
4
5 hscloud = import ./default.nix {};
6
7in with hscloud.config.pkgs; let
8
9 wrapper = pkgs.writeScript "wrapper.sh"
10 ''
11 source /etc/profile
12 source ${toString ./.}/env.sh
13 ${toString ./.}/tools/install.sh
14
Serge Bazanski69ff6032021-09-11 01:14:13 +020015 # Fancy colorful PS1 to make people notice easily they're in hscloud.
16 PS1='\[\033]0;\u/hscloud:\w\007\]'
17 if type -P dircolors >/dev/null ; then
18 PS1+='\[\033[01;35m\]\u/hscloud\[\033[01;34m\] \w \$\[\033[00m\] '
19 fi
20 export PS1
21
Serge Bazanskic97461e2021-02-17 20:29:48 +010022 exec bash "$@"
23 '';
24
25in (pkgs.buildFHSUserEnv {
26 name = "hscloud-build";
27 targetPkgs = pkgs: with pkgs; [
28 bazel
29 postgresql
30 python38
31 openjdk11
32 openldap.dev cyrus_sasl.dev # for python-ldap
33 wkhtmltopdf
Serge Bazanskidce10ba2021-03-11 23:16:10 +000034 gcc binutils
Serge Bazanski43b0e092021-06-06 12:50:54 +000035 pwgen
36 tmate
Mateusz Lenik51f6c102021-07-18 16:33:03 +020037 git
Serge Bazanskic97461e2021-02-17 20:29:48 +010038 ];
39 multiPkgs = pkgs: [
40 (pkgs.runCommand "protocols" {}
41 ''
42 mkdir -p $out/etc
43 ln -s ${pkgs.iana-etc}/etc/protocols $out/etc/protocols
44 '')
45 ];
46 runScript = wrapper;
47}).env