elendel: Initialize new host

This commit is contained in:
Charlotte Van Petegem 2024-11-10 14:05:05 +01:00
parent 4dd8568fd2
commit 1caf599f73
No known key found for this signature in database
GPG key ID: 019E764B7184435A
73 changed files with 334 additions and 175 deletions

View file

@ -0,0 +1,48 @@
{ pkgs, ... }:
{
imports = [ ./hardware.nix ];
time.timeZone = "Europe/Brussels";
networking = {
hostId = "338495bc";
useDHCP = false;
};
systemd.network = {
enable = true;
networks."enp7s0" = {
enable = true;
matchConfig = { Name = "enp7s0"; };
address = [
"37.27.113.55/26"
"2a01:4f9:3070:2382::/64"
];
gateway = [ "37.27.113.1" ];
routes = [
{
Gateway = "fe80::1";
GatewayOnLink = true;
}
];
dns = [
"1.1.1.1"
"1.0.0.1"
"2606:4700:4700::1111"
"2606:4700:4700::1001"
];
};
};
chvp = {
stateVersion = "24.11";
base = {
nix.enableDirenv = true;
zfs = {
enable = true;
rootDataset = "zroot/local/root";
};
};
};
}

View file

@ -0,0 +1,78 @@
{ lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
loader = {
grub = {
enable = true;
efiSupport = true;
mirroredBoots = [
{ devices = [ "nodev" ]; path = "/boot/ESP0"; }
{ devices = [ "nodev" ]; path = "/boot/ESP1"; }
];
};
efi.canTouchEfiVariables = true;
};
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ];
kernelModules = [ "kvm-amd" ];
};
fileSystems = {
"/" = {
device = "zroot/local/root";
fsType = "zfs";
neededForBoot = true;
};
"/nix" = {
device = "zroot/local/nix";
fsType = "zfs";
neededForBoot = true;
};
"/nix/store" = {
device = "zroot/local/nix-store";
fsType = "zfs";
neededForBoot = true;
};
"/cache" = {
device = "zroot/local/cache";
fsType = "zfs";
neededForBoot = true;
};
"/data" = {
device = "zroot/safe/data";
fsType = "zfs";
neededForBoot = true;
};
"/srv/data" = {
device = "zdata/data";
fsType = "zfs";
};
"/boot/ESP0" = {
device = "/dev/disk/by-uuid/DA42-87E1";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
"/boot/ESP1" = {
device = "/dev/disk/by-uuid/DA6B-6F76";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/5e9ba365-bd67-49c8-9972-b853c759d132"; }
{ device = "/dev/disk/by-uuid/cf8ef6ea-e280-4ae6-bbd4-7018fd573fe4"; }
{ device = "/dev/disk/by-uuid/086a5b7b-09c8-4270-bd72-cc99260c0583"; }
{ device = "/dev/disk/by-uuid/c683d01d-56e9-4dd5-aa9d-6d04864f01a9"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware = {
cpu.amd.updateMicrocode = true;
enableRedistributableFirmware = true;
};
services.fstrim.enable = true;
}

View file

@ -15,9 +15,7 @@
};
efi.canTouchEfiVariables = true;
};
initrd = {
availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
};
initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
kernelModules = [ "kvm-intel" ];
};
@ -66,10 +64,12 @@
"/boot/ESP0" = {
device = "/dev/disk/by-uuid/6ED1-0638";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
"/boot/ESP1" = {
device = "/dev/disk/by-uuid/6F25-C8B8";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
};
@ -80,6 +80,7 @@
{ device = "/dev/disk/by-uuid/088f30de-c76d-4843-ac62-8442852b372d"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware = {
cpu.intel.updateMicrocode = true;