From a3b7de0dd5122fe4275e8cb2e090af02d45212bd Mon Sep 17 00:00:00 2001 From: Marko Kaapu Date: Tue, 28 Nov 2023 13:14:30 +0200 Subject: [PATCH 1/2] Add Ficolo builder configuration Signed-off-by: Marko Kaapu --- hosts/default.nix | 4 ++ hosts/ficolobuild/configuration.nix | 39 +++++++++++++ hosts/ficolobuild/disk-config.nix | 91 +++++++++++++++++++++++++++++ tasks.py | 3 + users/default.nix | 1 + users/mkaapu.nix | 14 +++++ 6 files changed, 152 insertions(+) create mode 100644 hosts/ficolobuild/configuration.nix create mode 100644 hosts/ficolobuild/disk-config.nix create mode 100644 users/mkaapu.nix diff --git a/hosts/default.nix b/hosts/default.nix index 63987dd4..ca5f85b4 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -31,5 +31,9 @@ inherit specialArgs; modules = [./monitoring/configuration.nix]; }; + ficolobuild = lib.nixosSystem { + inherit specialArgs; + modules = [./ficolobuild/configuration.nix]; + }; }; } diff --git a/hosts/ficolobuild/configuration.nix b/hosts/ficolobuild/configuration.nix new file mode 100644 index 00000000..adb008a7 --- /dev/null +++ b/hosts/ficolobuild/configuration.nix @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) +# +# SPDX-License-Identifier: Apache-2.0 +{ + self, + config, + inputs, + lib, + modulesPath, + ... +}: { + imports = lib.flatten [ + (modulesPath + "/installer/scan/not-detected.nix") + inputs.disko.nixosModules.disko + (with self.nixosModules; [ + common + service-openssh + user-cazfi + user-hrosten + user-jrautiola + user-mkaapu + ]) + ./disk-config.nix + ]; + + # Hardwre Configuration: + + boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "megaraid_sas" "nvme" "usbhid" "sd_mod"]; + boot.kernelModules = ["kvm-intel"]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # Installation: + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/ficolobuild/disk-config.nix b/hosts/ficolobuild/disk-config.nix new file mode 100644 index 00000000..ead84fdc --- /dev/null +++ b/hosts/ficolobuild/disk-config.nix @@ -0,0 +1,91 @@ +# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) +# +# SPDX-License-Identifier: Apache-2.0 +# BIOS compatible gpt partition +{ + disko.devices = { + disk = { + sdb = { + device = "/dev/sdb"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/sata"; + }; + }; + }; + }; + }; + sda = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + nix = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + root = { + device = "/dev/nvme0n1"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + nix = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + home = { + device = "/dev/nvme1n1"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + nix = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/home"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/tasks.py b/tasks.py index e0532f66..45805349 100644 --- a/tasks.py +++ b/tasks.py @@ -82,6 +82,9 @@ class TargetHost: "monitoring-ficolo": TargetHost( hostname="172.18.20.108", nixosconfig="monitoring" ), + "build3-ficolo": TargetHost( + hostname="172.18.20.104", nixosconfig="ficolobuild" + ), } ) diff --git a/users/default.nix b/users/default.nix index 09b4af3c..4b67ee7f 100644 --- a/users/default.nix +++ b/users/default.nix @@ -10,5 +10,6 @@ user-jrautiola = import ./jrautiola.nix; user-hydra = import ./hydra.nix; user-cazfi = import ./cazfi.nix; + user-mkaapu = import ./mkaapu.nix; }; } diff --git a/users/mkaapu.nix b/users/mkaapu.nix new file mode 100644 index 00000000..bb7471e9 --- /dev/null +++ b/users/mkaapu.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) +# +# SPDX-License-Identifier: Apache-2.0 +{ + users.users = { + mkaapu = { + isNormalUser = true; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE6WDXGfrD+WfY2+eP+/c4NrEOeCGpEOE2TcTlwxWXho marko.kaapu@unikie.com" + ]; + extraGroups = ["wheel" "networkmanager"]; + }; + }; +} From 05028c180b8fa494e66233b6b2b4010485f33c56 Mon Sep 17 00:00:00 2001 From: Marko Kaapu Date: Thu, 30 Nov 2023 17:43:09 +0200 Subject: [PATCH 2/2] Fix disk config for Ficolo builders Signed-off-by: Marko Kaapu --- hosts/ficolobuild/disk-config.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hosts/ficolobuild/disk-config.nix b/hosts/ficolobuild/disk-config.nix index ead84fdc..7855180d 100644 --- a/hosts/ficolobuild/disk-config.nix +++ b/hosts/ficolobuild/disk-config.nix @@ -5,8 +5,8 @@ { disko.devices = { disk = { - sdb = { - device = "/dev/sdb"; + sda = { + device = "/dev/sda"; type = "disk"; content = { type = "gpt"; @@ -35,8 +35,8 @@ }; }; }; - sda = { - device = "/dev/sda"; + sdb = { + device = "/dev/sdb"; type = "disk"; content = { type = "gpt";