blob: e52c7412d11ff950f5558be8830dd91933543b9d [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
Bartosz Stebel56ff18c2021-08-30 23:28:45 +02007in with hscloud.pkgs; let
Serge Bazanskic97461e2021-02-17 20:29:48 +01008
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
Piotr Dobrowolskicb9cbb32021-09-14 18:37:10 +020038 which
39 nettools
Serge Bazanskic97461e2021-02-17 20:29:48 +010040 ];
41 multiPkgs = pkgs: [
42 (pkgs.runCommand "protocols" {}
43 ''
44 mkdir -p $out/etc
45 ln -s ${pkgs.iana-etc}/etc/protocols $out/etc/protocols
46 '')
47 ];
48 runScript = wrapper;
49}).env