This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / machines / hilum / flash-stick.sh
1.2 kB 43 lines
1#!/bin/sh 2set -efux 3 4disk=$1 5 6cd "$(dirname "$0")" 7export NIXPKGS_ALLOW_UNFREE=1 8(umask 077; pass show admin/hilum/luks > /tmp/hilum.luks) 9trap 'rm -f /tmp/hilum.luks' EXIT 10echo "$disk" > /tmp/hilum-disk 11trap 'rm -f /tmp/hilum-disk' EXIT 12 13stockholm_root=$(git rev-parse --show-toplevel) 14ssh root@localhost -t -- $(nix-build \ 15 --no-out-link \ 16 -I nixpkgs=/var/src/nixpkgs \ 17 -I stockholm="$stockholm_root" \ 18 -I secrets="$stockholm_root"/lass/2configs/tests/dummy-secrets \ 19 -E "with import <nixpkgs> {}; (pkgs.nixos [ 20 { 21 luksPassFile = \"/tmp/hilum.luks\"; 22 mainDisk = \"$disk\"; 23 disko.rootMountPoint = \"/mnt/hilum\"; 24 } 25 ./physical.nix 26 ]).disko" 27) 28rm -f /tmp/hilum.luks 29$(nix-build \ 30 --no-out-link \ 31 -I nixpkgs=/var/src/nixpkgs \ 32 "$stockholm_root"/lass/krops.nix -A populate \ 33 --argstr name hilum \ 34 --argstr target "root@localhost/mnt/hilum/var/src" \ 35 --arg force true 36) 37ssh root@localhost << SSH 38set -efux 39mkdir -p /mnt/hilum/etc 40NIXOS_CONFIG=/mnt/hilum/var/src/nixos-config nixos-install --no-bootloader --no-root-password --root /mnt/hilum -I /var/src 41nixos-enter --root /mnt/hilum -- nixos-rebuild -I /var/src switch --install-bootloader 42umount -Rv /mnt/hilum 43SSH