Merge pull request from nix-community/build04

add build04
This commit is contained in:
Jörg Thalheim 2021-08-18 08:01:52 +01:00 committed by GitHub
commit a35272b352
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 114 additions and 1 deletions

View file

@ -59,6 +59,16 @@ This machine is a replacement for build01.
* RAM: 64GB DDR4 ECC
* Drives: 2 x 512 TB NVME in RAID 1
### `build04`
This machine is meant as an aarch64 builder for our hydra instance running on build03.
* Provider: Oracle cloud
* Instance type: [Ampere A1 Compute](https://www.oracle.com/cloud/compute/arm/)
* CPU: 4 VCPUs on an Ampere Altra (arm64)
* RAM: 24GB
* Drives: 200 GB Block
## Cache
All the builds on these machines are pushed to https://nix-community.cachix.org/

45
build04/configuration.nix Normal file
View file

@ -0,0 +1,45 @@
{ config, pkgs, lib, ... }:
{
imports = [
./hardware-configuration.nix
../roles/common.nix
];
nixpkgs.system = "aarch64-linux";
# we use grub because systemd-boot sometimes fail on aarch64/EFI
boot.loader.grub.devices = [ "nodev" ];
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.version = 2;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.extraConfig = ''
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal_input --append serial
terminal_output --append serial
'';
networking.hostName = "nix-community-build04";
networking.hostId = "8daf74c0";
networking.usePredictableInterfaceNames = false;
# networkd chokes on some ipv6 messages that the oracle network sends
networking.dhcpcd.enable = true;
system.stateVersion = "21.11";
}
# after loading kexec, be patient. The kexec image can take up to 5 minutes to boot
# partition guide
/*
sgdisk -n 1:0:+800M -N 2 -t 1:ef00 -t 2:8304 /dev/sda
mkfs.vfat -b32 /dev/sda1
zpool create zroot -O acltype=posixacl -O xattr=sa -O compression=lz4 /dev/sda2
zfs create -o mountpoint=none zroot/root
zfs create -o mountpoint=legacy zroot/root/nixos
zfs create -o mountpoint=legacy zroot/root/home
mount -t zfs zroot/root/nixos /mnt
mkdir /mnt/{home,boot}
mount -t zfs zroot/root/home /mnt/home
mount /dev/sda1 /mnt/boot
*/

View file

@ -0,0 +1,32 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "zroot/root/nixos";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "zroot/root/home";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E6D6-572B";
fsType = "vfat";
};
swapDevices = [ ];
}

View file

@ -163,4 +163,13 @@ in
permissions = "0600";
};
};
build04 =
{ resources, ... }:
{
imports = [
./build04/configuration.nix
];
deployment.targetHost = "158.101.223.107";
};
}

View file

@ -5,7 +5,7 @@ let
niv;
nixopsUnstable = (pkgs.nixopsUnstable.withPlugins(ps: []));
terraform = pkgs.terraform.withPlugins (
terraform = pkgs.terraform_0_12.withPlugins (
p: [
p.cloudflare
p.null

View file

@ -6,6 +6,9 @@
./users.nix
./sshd.nix
];
# ttyAMA0 is consoles on aarch64
boot.kernelParams = [ "console=ttyS0,115200n8" "console=ttyAMA0,115200n8" "console=tty0" ];
}
# Hetzner bootstrap from rescue system

BIN
secrets/build04-root.txt Normal file

Binary file not shown.

View file

@ -44,6 +44,20 @@ resource "cloudflare_record" "nix-community-org-build03-AAAA" {
type = "AAAA"
}
resource "cloudflare_record" "nix-community-org-build04-A" {
zone_id = local.nix_community_org_zone_id
name = "build04"
value = "158.101.223.107"
type = "A"
}
resource "cloudflare_record" "nix-community-org-build04-AAAA" {
zone_id = local.nix_community_org_zone_id
name = "build04"
value = "2603:c022:c001:b500:1::"
type = "AAAA"
}
# Used by nix-community/nixpkgs-docker
resource "cloudflare_record" "nix-community-org-docker-CNAME" {
zone_id = local.nix_community_org_zone_id