feat(servers): add init cluster hw configs
All checks were successful
Discord / discord commits (push) Successful in 27s

This commit is contained in:
matt1432 2024-01-21 20:08:27 -05:00
parent 78d7ef4206
commit 4ea15b6a9c
4 changed files with 100 additions and 0 deletions

View file

@ -67,6 +67,7 @@
virtualisation = {
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
};
environment.systemPackages = with pkgs; [
qemu

View file

@ -0,0 +1,43 @@
deviceName: {config, ...}: let
inherit (config.vars) mainUser hostName;
in {
imports = [
./hardware-configuration.nix
../../modules/kmscon.nix
../../modules/sshd.nix
../../modules/tailscale.nix
];
vars = {
mainUser = "matt";
hostName = deviceName;
};
users.users.${mainUser} = {
isNormalUser = true;
extraGroups = [
"wheel"
"adm"
];
};
home-manager.users.${mainUser} = {
imports = [];
# No touchy
home.stateVersion = "24.05";
};
networking = {
inherit hostName;
resolvconf.enable = true;
firewall.enable = false;
};
# Set your time zone.
time.timeZone = "America/Montreal";
# No touchy
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,48 @@
{
config,
modulesPath,
...
}: {
nixpkgs.hostPlatform = "x86_64-linux";
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot = {
loader = {
timeout = 2;
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
};
"/boot" = {
device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
};
swapDevices = [
{
device = "/var/lib/swapfile";
size = 16 * 1024;
}
];
zramSwap.enable = true;
hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware;
}

View file

@ -48,6 +48,14 @@
secrets.nixosModules.oksys
];
# Cluster
thingone = mkNixOS [
(import ./devices/cluster "thingone")
];
thingtwo = mkNixOS [
(import ./devices/cluster "thingtwo")
];
live-image = mkNixOS [
("${nixpkgs}/nixos/modules/installer/"
+ "cd-dvd/installation-cd-minimal.nix")