diff options
-rw-r--r-- | krebs/1systems/hotdog/config.nix | 1 | ||||
-rw-r--r-- | krebs/1systems/puyak/config.nix | 1 | ||||
-rw-r--r-- | krebs/1systems/wolf/config.nix | 1 | ||||
-rw-r--r-- | krebs/2configs/binary-cache/nixos.nix | 12 | ||||
-rw-r--r-- | lass/5pkgs/init/default.nix | 2 | ||||
-rw-r--r-- | shell.nix | 51 |
6 files changed, 51 insertions, 17 deletions
diff --git a/krebs/1systems/hotdog/config.nix b/krebs/1systems/hotdog/config.nix index 3eb7b9aa1..9d87eba48 100644 --- a/krebs/1systems/hotdog/config.nix +++ b/krebs/1systems/hotdog/config.nix @@ -10,6 +10,7 @@ <stockholm/krebs/2configs> <stockholm/krebs/2configs/buildbot-all.nix> + <stockholm/krebs/2configs/binary-cache/nixos.nix> ]; krebs.build.host = config.krebs.hosts.hotdog; diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index deede4493..d4a4941ca 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -9,6 +9,7 @@ <stockholm/krebs/2configs/buildbot-krebs.nix> <stockholm/krebs/2configs/stats/puyak-client.nix> + <stockholm/krebs/2configs/binary-cache/nixos.nix> <stockholm/krebs/2configs/binary-cache/prism.nix> ]; diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index ec9c78db5..91aabb716 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -13,6 +13,7 @@ in <stockholm/krebs/2configs/graphite.nix> <stockholm/krebs/2configs/buildbot-krebs.nix> + <stockholm/krebs/2configs/binary-cache/nixos.nix> <stockholm/krebs/2configs/binary-cache/prism.nix> <stockholm/krebs/2configs/shack/worlddomination.nix> diff --git a/krebs/2configs/binary-cache/nixos.nix b/krebs/2configs/binary-cache/nixos.nix new file mode 100644 index 000000000..2ff5e1307 --- /dev/null +++ b/krebs/2configs/binary-cache/nixos.nix @@ -0,0 +1,12 @@ +{ config, ... }: + +{ + nix = { + binaryCaches = [ + "https://cache.nixos.org/" + ]; + binaryCachePublicKeys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + }; +} diff --git a/lass/5pkgs/init/default.nix b/lass/5pkgs/init/default.nix index 679187531..b386fa94b 100644 --- a/lass/5pkgs/init/default.nix +++ b/lass/5pkgs/init/default.nix @@ -46,7 +46,7 @@ pkgs.writeText "init" '' # dd if=/dev/zero bs=512 count=34 of=/dev/sda # TODO zero last 34 blocks (lsblk -bno SIZE /dev/sda) if ! test "$(blkid -o value -s PTTYPE "$disk")" = gpt; then - parted -a optimal "$disk" \ + parted -s -a optimal "$disk" \ mklabel gpt \ mkpart no-fs 0 1024KiB \ set 1 bios_grub on \ @@ -8,6 +8,7 @@ let # usage: deploy [--force-populate] [--user=USER] # --system=SYSTEM [--target=TARGET] + # [--verbose] cmds.deploy = pkgs.writeDash "cmds.deploy" '' set -efu @@ -65,6 +66,7 @@ let # usage: test [--force-populate] [--user=USER] # --system=SYSTEM --target=TARGET + # [--verbose] cmds.test = pkgs.writeDash "cmds.test" /* sh */ '' set -efu @@ -145,13 +147,14 @@ let init.args = pkgs.writeText "init.args" /* sh */ '' args=$(${pkgs.utillinux}/bin/getopt -n "$command" -s sh \ -o s:t:u: \ - -l force-populate,system:,target:,user: \ + -l force-populate,system:,target:,user:,verbose \ -- "$@") if \test $? != 0; then exit 1; fi eval set -- "$args" force_populate=false; while :; do case $1 in --force-populate) force_populate=true; shift;; + --verbose) verbose=true; shift;; -s|--system) system=$2; shift 2;; -t|--target) target=$2; shift 2;; -u|--user) user=$2; shift 2;; @@ -194,6 +197,7 @@ let cd "$target_path/stockholm" \; \ NIX_PATH=$(quote "$target_path") \ STOCKHOLM_VERSION=$(quote "$STOCKHOLM_VERSION") \ + verbose=$(quote "$verbose") \ nix-shell --run "$(quote " system=$(quote "$system") \ target=$(quote "$target") \ @@ -206,24 +210,38 @@ let utils.build = pkgs.writeDash "utils.build" '' set -efu - ${pkgs.nix}/bin/nix-build \ - -Q \ - --no-out-link \ - --show-trace \ - -E "with import <stockholm>; $1" \ - -I "$target_path" \ - 2>&1 | - ${pkgs.whatsupnix}/bin/whatsupnix + if test "$verbose" = true; then + ${pkgs.nix}/bin/nix-build \ + --no-out-link \ + --show-trace \ + -E "with import <stockholm>; $1" \ + -I "$target_path" + else + ${pkgs.nix}/bin/nix-build \ + -Q \ + --no-out-link \ + --show-trace \ + -E "with import <stockholm>; $1" \ + -I "$target_path" \ + 2>&1 | + ${pkgs.whatsupnix}/bin/whatsupnix + fi ''; utils.deploy = pkgs.writeDash "utils.deploy" '' - set -efu - PATH=/run/current-system/sw/bin nixos-rebuild switch \ - -Q \ - --show-trace \ - -I "$target_path" \ - 2>&1 | - ${pkgs.whatsupnix}/bin/whatsupnix + set -xefu + if test "$verbose" = true; then + PATH=/run/current-system/sw/bin nixos-rebuild switch \ + --show-trace \ + -I "$target_path" + else + PATH=/run/current-system/sw/bin nixos-rebuild switch \ + -Q \ + --show-trace \ + -I "$target_path" \ + 2>&1 | + ${pkgs.whatsupnix}/bin/whatsupnix + fi ''; shell.get-version = pkgs.writeDash "shell.get-version" '' @@ -270,6 +288,7 @@ in pkgs.stdenv.mkDerivation { export HOSTNAME="$(${pkgs.nettools}/bin/hostname)" export STOCKHOLM_VERSION="''${STOCKHOLM_VERSION-$(${shell.get-version})}" + export verbose="''${verbose-false}" PS1='\[\e[38;5;162m\]\w\[\e[0m\] ' ''; |