Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ficolo builder configuration #28

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
host-ghafhydra = import ./ghafhydra;
host-binarycache = import ./binarycache;
host-monitoring = import ./monitoring;
host-ficolobuild = import ./ficolobuild;
};

flake.nixosConfigurations = let
Expand All @@ -41,5 +42,9 @@
inherit specialArgs;
modules = [self.nixosModules.host-monitoring];
};
ficolobuild = lib.nixosSystem {
inherit specialArgs;
modules = [self.nixosModules.host-ficolobuild];
};
};
}
34 changes: 34 additions & 0 deletions hosts/ficolobuild/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII)
#
# SPDX-License-Identifier: Apache-2.0
{ config, lib, pkgs, ... }:

{
imports =
[
./hardware-configuration.nix
./disk-config.nix
];

# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

# networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.

# Set your time zone.
time.timeZone = "Europe/Helsinki";

# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
curl
gitMinimal
];

# Enable the OpenSSH daemon.
services.openssh.enable = true;

system.stateVersion = "23.11";
}
27 changes: 27 additions & 0 deletions hosts/ficolobuild/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII)
#
# SPDX-License-Identifier: Apache-2.0
{
self,
inputs,
lib,
...
}: {
flake.nixosConfigurations = {
generic-x86_64-linux = lib.nixosSystem {
specialArgs = {
inherit self inputs;
};
modules = [
inputs.disko.nixosModules.disko
(with self.nixosModules; [
user-cazfi
user-hrosten
user-jrautiola
user-mkaapu
])
./configuration.nix
];
};
};
}
88 changes: 88 additions & 0 deletions hosts/ficolobuild/disk-config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 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 = "EFOO";
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";
};
};
};
};
};
};
};
}
32 changes: 32 additions & 0 deletions hosts/ficolobuild/hardware-configuration.nix
mkaapu marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -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 + "/installer/scan/not-detected.nix")
];

boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "megaraid_sas" "nvme" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.eno2.useDHCP = lib.mkDefault true;
# networking.interfaces.eno3.useDHCP = lib.mkDefault true;
# networking.interfaces.eno4.useDHCP = lib.mkDefault true;
# networking.interfaces.enp216s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp216s0f1.useDHCP = lib.mkDefault true;
# networking.interfaces.enp94s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp94s0f1.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
3 changes: 3 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
),
}
)

Expand Down
1 change: 1 addition & 0 deletions users/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
user-jrautiola = import ./jrautiola.nix;
user-hydra = import ./hydra.nix;
user-cazfi = import ./cazfi.nix;
user-mkaapu = import ./mkaapu.nix;
};
}
14 changes: 14 additions & 0 deletions users/mkaapu.nix
Original file line number Diff line number Diff line change
@@ -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"];
};
};
}
Loading