2021-02-17 19:29:48 +00:00
|
|
|
# Shell for being able to use bazel on NixOS (or on any operating system with Nix installed).
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
hscloud = import ./default.nix {};
|
|
|
|
|
2021-08-30 21:28:45 +00:00
|
|
|
in with hscloud.pkgs; let
|
2021-02-17 19:29:48 +00:00
|
|
|
|
2022-04-26 21:09:43 +00:00
|
|
|
fontconfig = pkgs.writeText "fc-00-nixos-cache.conf" ''
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
|
|
|
<fontconfig>
|
|
|
|
<include>/etc/fonts/fonts.conf</include>
|
|
|
|
<dir>${pkgs.roboto}</dir>
|
|
|
|
</fontconfig>
|
|
|
|
'';
|
|
|
|
|
2021-02-17 19:29:48 +00:00
|
|
|
wrapper = pkgs.writeScript "wrapper.sh"
|
|
|
|
''
|
2022-04-26 21:09:43 +00:00
|
|
|
export NIX_SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
|
|
|
|
export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
|
|
|
|
export FONTCONFIG_FILE="${fontconfig}"
|
2024-02-25 17:42:48 +00:00
|
|
|
export SHELL="${pkgs.bash}/bin/bash"
|
2023-10-13 11:42:53 +00:00
|
|
|
export HSCLOUD_NIX=yes
|
2022-04-26 21:09:43 +00:00
|
|
|
|
2021-02-17 19:29:48 +00:00
|
|
|
source ${toString ./.}/env.sh
|
2022-04-26 21:09:43 +00:00
|
|
|
|
|
|
|
# FIXME: //tools:install runs in a different PATH which thrashes our cache
|
|
|
|
# and causes massive rebuilds on every launch... This next line is the only
|
|
|
|
# important part off tools/install.sh
|
|
|
|
# bazel run //tools:install
|
2023-07-28 17:14:50 +00:00
|
|
|
#bazel build //tools/... //cluster/tools/...
|
2021-02-17 19:29:48 +00:00
|
|
|
|
2021-09-10 23:14:13 +00:00
|
|
|
# Fancy colorful PS1 to make people notice easily they're in hscloud.
|
|
|
|
PS1='\[\033]0;\u/hscloud:\w\007\]'
|
|
|
|
if type -P dircolors >/dev/null ; then
|
|
|
|
PS1+='\[\033[01;35m\]\u/hscloud\[\033[01;34m\] \w \$\[\033[00m\] '
|
|
|
|
fi
|
|
|
|
export PS1
|
|
|
|
|
2022-04-26 21:09:43 +00:00
|
|
|
exec bash --noprofile --norc "$@"
|
2021-02-17 19:29:48 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
in (pkgs.buildFHSUserEnv {
|
|
|
|
name = "hscloud-build";
|
|
|
|
targetPkgs = pkgs: with pkgs; [
|
2022-11-26 20:33:38 +00:00
|
|
|
bazel_5
|
2021-02-17 19:29:48 +00:00
|
|
|
postgresql
|
2023-07-28 17:14:50 +00:00
|
|
|
python310
|
2021-02-17 19:29:48 +00:00
|
|
|
openjdk11
|
|
|
|
openldap.dev cyrus_sasl.dev # for python-ldap
|
2023-07-28 17:14:50 +00:00
|
|
|
# No wkhtmltopdf as it got yoten from the hydra build set, and building it
|
|
|
|
# takes ages. Run locally in docker container instead.
|
|
|
|
#wkhtmltopdf
|
|
|
|
gcc binutils clang
|
|
|
|
libxcrypt-legacy
|
2021-06-06 12:50:54 +00:00
|
|
|
pwgen
|
|
|
|
tmate
|
2021-07-18 14:33:03 +00:00
|
|
|
git
|
2021-09-14 16:37:10 +00:00
|
|
|
which
|
2021-09-14 17:57:03 +00:00
|
|
|
gnupg
|
2021-09-14 16:37:10 +00:00
|
|
|
nettools
|
2022-04-26 21:09:43 +00:00
|
|
|
file
|
|
|
|
curl
|
|
|
|
netcat
|
|
|
|
nix
|
2022-06-11 12:16:12 +00:00
|
|
|
vim
|
|
|
|
openssh
|
2023-03-02 09:32:46 +00:00
|
|
|
libxcrypt
|
2023-10-08 12:28:06 +00:00
|
|
|
zlib
|
2024-02-01 22:28:14 +00:00
|
|
|
|
|
|
|
colmena
|
2021-02-17 19:29:48 +00:00
|
|
|
];
|
|
|
|
multiPkgs = pkgs: [
|
|
|
|
(pkgs.runCommand "protocols" {}
|
|
|
|
''
|
|
|
|
mkdir -p $out/etc
|
|
|
|
ln -s ${pkgs.iana-etc}/etc/protocols $out/etc/protocols
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
runScript = wrapper;
|
|
|
|
}).env
|