ops/nixos: add other blade hosts

blade-paris and blade-kim are TBD
This commit is contained in:
Luke Granger-Brown 2021-02-08 22:26:22 +00:00
parent 36bb93a80e
commit dad04a0062
8 changed files with 173 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, rebuilder, config, ... }:
let
inherit (depot.ops) secrets;
in {
imports = [
../lib/blade.nix
];
boot.loader.grub.device = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_01012b89ef8e36218414588461cda968a6fbfa5bf39e398aaeda43d9e398b05f86800000000000000000000097b1f26d001a240091558107b6a8e160-0:0";
# Networking!
networking = {
hostName = "blade-chakotay";
hostId = "40bc5a75";
interfaces.bond0.ipv4.addresses = [{
address = "192.168.1.182";
prefixLength = 24;
}];
};
}

View file

@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, rebuilder, config, ... }:
let
inherit (depot.ops) secrets;
in {
imports = [
../lib/blade.nix
];
boot.loader.grub.device = "";
# Networking!
networking = {
hostName = "blade-kim";
hostId = "1643efb6";
interfaces.bond0.ipv4.addresses = [{
address = "192.168.1.183";
prefixLength = 24;
}];
};
}

View file

@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, rebuilder, config, ... }:
let
inherit (depot.ops) secrets;
in {
imports = [
../lib/blade.nix
];
boot.loader.grub.device = "";
# Networking!
networking = {
hostName = "blade-paris";
hostId = "41b2a198";
interfaces.bond0.ipv4.addresses = [{
address = "192.168.1.184";
prefixLength = 24;
}];
};
}

View file

@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, rebuilder, config, ... }:
let
inherit (depot.ops) secrets;
in {
imports = [
../lib/blade.nix
];
boot.loader.grub.device = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_01011cbe2d1b827aedae2d5668fecf2a2dbdab7d0ecc0416f6e7c5485ecec8f5e5870000000000000000000080ce63590095210091558107b6a8e55d-0:0";
# Networking!
networking = {
hostName = "blade-torres";
hostId = "86db1d9c";
interfaces.bond0.ipv4.addresses = [{
address = "192.168.1.185";
prefixLength = 24;
}];
};
}

View file

@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, rebuilder, config, ... }:
let
inherit (depot.ops) secrets;
in {
imports = [
../lib/blade.nix
];
boot.loader.grub.device = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0101cabb1ebdbdc0fd7b18edd207d43717c39c4a59d1b138b363e315841eca15743400000000000000000000443273100087260091558107b6a8e06e-0:0";
# Networking!
networking = {
hostName = "blade-tuvok";
hostId = "525229f7";
interfaces.bond0.ipv4.addresses = [{
address = "192.168.1.181";
prefixLength = 24;
}];
};
}

View file

@ -26,6 +26,11 @@ let
"clouvider-lon01"
"etheroute-lon01"
"blade-janeway"
"blade-tuvok"
"blade-paris"
"blade-torres"
"blade-chakotay"
"blade-kim"
];
rebuilder = system: (import ./lib/rebuilder.nix (args // { system = system; }));
systemCfgs = lib.genAttrs systems

45
ops/nixos/install.sh Executable file
View file

@ -0,0 +1,45 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
set -eu
if [ $EUID -ne 0 ]; then
exec sudo "$0" "$@"
fi
if [ $# -lt 1 ]; then
echo "Usage: $0 hostname" >&2
exit 1
fi
depot_parent() {
pd="$(readlink -f "$1")/"
if [ "${pd#*/depot/}" = "$pd" ]; then
return
fi
pd="$(readlink -f "${pd%/depot/*}/depot")"
echo "$pd"
}
depot_path() {
pd="$(depot_parent "$PWD")"
if [ "$pd" = "" ]; then
pd="$(depot_parent "$(readlink -f "$0")")"
fi
echo "$pd"
}
readonly targethostname="$1"
readonly depot="$(depot_path)"
if [ "$depot" = "" ]; then
echo "This script needs to be executed in-depot (or the script itself should be in-depot)."
exit 1
fi
readonly system="$(nix-build -E '(import "'"$(depot_path)"'" {}).ops.nixos.'"${targethostname}" --option sandbox false --no-out-link)"
nixos-install --root /mnt --system "$system" --no-root-passwd
echo "Copying myself..."
cp -R "$depot/" "/mnt/home/lukegb/depot/"

View file

@ -41,6 +41,9 @@ in {
miimon = "1000";
lacp_rate = "fast";
};
interfaces = [
"enp4s0f0" "enp4s0f1"
];
};
defaultGateway = "192.168.1.5";