marabethia: Initialize new host

This commit is contained in:
Charlotte Van Petegem 2024-11-09 21:26:40 +01:00
parent 0128fd3fa7
commit ceac7a451a
No known key found for this signature in database
GPG key ID: 019E764B7184435A
72 changed files with 332 additions and 193 deletions

View file

@ -0,0 +1,36 @@
{ pkgs, ... }:
{
imports = [ ./hardware.nix ];
time.timeZone = "Europe/Brussels";
networking.hostId = "10a4250f";
chvp = {
stateVersion = "24.11";
base = {
network = {
ovh = {
enable = true;
publicInterface = "eno1";
publicIPV4 = {
ip = "162.19.60.238";
gateway = "162.19.60.254";
};
publicIPV6 = {
ip = "2001:41d0:203:cdee::";
gateway = "2001:41d0:0203:cdff:00ff:00ff:00ff:00ff";
};
internalInterface = "eno2";
internalIPV4 = "192.168.0.3";
};
};
nix.enableDirenv = true;
zfs = {
enable = true;
rootDataset = "zroot/local/root";
};
};
};
}

View file

@ -0,0 +1,73 @@
{ 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" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
};
kernelModules = [ "kvm-intel" ];
};
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;
};
"/data" = {
device = "zroot/safe/data";
fsType = "zfs";
neededForBoot = true;
};
"/cache" = {
device = "zroot/local/cache";
fsType = "zfs";
neededForBoot = true;
};
"/boot/ESP0" = {
device = "/dev/disk/by-uuid/1779-70F4";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
"/boot/ESP1" = {
device = "/dev/disk/by-uuid/179D-4050";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/4662d37a-236f-451c-a2ec-521a19aa0e55"; }
{ device = "/dev/disk/by-uuid/31260b02-0867-4721-bc06-24b415c57f36"; }
];
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware = {
cpu.intel.updateMicrocode = true;
enableRedistributableFirmware = true;
};
services.fstrim.enable = true;
}