machines/Ophanim: migrate to new server

This commit is contained in:
Kevin Baensch 2025-03-21 23:18:32 +01:00
parent af81fb7b47
commit 80926102f4
Signed by: derped
GPG key ID: C0F1D326C7626543
5 changed files with 161 additions and 64 deletions

View file

@ -1,36 +1,114 @@
{
nixpkgs,
pkgs,
lib,
modulesPath,
...
}:
{
imports = [
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
(modulesPath + "/profiles/qemu-guest.nix")
];
boot = {
initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"sd_mod"
"sr_mod"
];
kernelPackages = pkgs.linuxPackages_latest;
loader.systemd-boot = {
enable = true;
};
loader.efi.canTouchEfiVariables = true;
supportedFilesystems = [ "btrfs" ];
initrd = {
availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
kernelModules = [ ];
};
kernelModules = [ ];
extraModulePackages = [ ];
loader.grub = {
enable = true;
device = "/dev/sda"; # or "nodev" for efi only
};
};
fileSystems =
let
btrfsDev = "13d40c4f-baaa-4a17-9032-b25aad202384";
in
{
"/" = {
device = "none";
fsType = "tmpfs";
neededForBoot = true;
options = [
"defaults"
"size=4G"
"mode=755"
"noexec"
];
};
"/tmp" = {
device = "/dev/disk/by-uuid/${btrfsDev}";
fsType = "btrfs";
options = [
"noexec"
"noatime"
"compress=zstd"
"subvol=tmp"
];
neededForBoot = true;
};
"/snapshots" = {
device = "/dev/disk/by-uuid/${btrfsDev}";
fsType = "btrfs";
options = [
"noexec"
"noatime"
"compress=zstd"
"subvol=snapshots"
];
neededForBoot = false;
};
"/persist" = {
device = "/dev/disk/by-uuid/${btrfsDev}";
fsType = "btrfs";
options = [
"noexec"
"noatime"
"compress=zstd"
"subvol=persist"
];
neededForBoot = true;
};
"/nix" = {
device = "/dev/disk/by-uuid/${btrfsDev}";
fsType = "btrfs";
options = [
"noatime"
"compress=zstd"
"subvol=nix"
];
neededForBoot = true;
};
"/boot" = {
device = "/dev/disk/by-uuid/5491-80AC";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
};
# 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;
time.timeZone = "Europe/Berlin";
fileSystems."/" = {
device = "/dev/disk/by-uuid/fa0c2ff3-59f9-4c00-8153-c2c2ef0f0e84";
fsType = "ext4";
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}