Add theia stuffies

This commit is contained in:
blahai 2025-01-12 22:44:11 +02:00
parent 452e600c5f
commit ad09e551fd
Signed by: blahai
SSH key fingerprint: SHA256:ZfCryi+V64yG+vC1ZIIsqgvBCmA31tTi7RJ6M8CvpRc
11 changed files with 135 additions and 2 deletions

View file

@ -1 +1,31 @@
{} {
lib,
config,
...
}: let
inherit (lib.modules) mkIf mkDefault;
inherit (lib.options) mkOption;
inherit (lib.types) nullOr str;
cfg = config.olympus.system.boot;
in {
options.olympus.system.boot.grub = {
device = mkOption {
type = nullOr str;
default = "nodev";
description = "The device to install the bootloader to.";
};
};
config = mkIf (cfg.loader == "grub") {
boot.loader.grub = {
enable = mkDefault true;
useOSProber = false;
efiSupport = false;
enableCryptodisk = mkDefault false;
inherit (cfg.grub) device;
theme = null;
backgroundColor = null;
splashImage = null;
};
};
}

View file

@ -6,7 +6,7 @@
inherit (config.olympus) device; inherit (config.olympus) device;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
in { in {
config = mkIf (device.cpu == "amd") { config = mkIf (device.cpu == "amd" || device.cpu == "vm-amd") {
hardware.cpu.amd.updateMicrocode = true; hardware.cpu.amd.updateMicrocode = true;
boot.kernelModules = [ boot.kernelModules = [

View file

@ -9,6 +9,7 @@ in {
type = types.nullOr ( type = types.nullOr (
types.enum [ types.enum [
"amd" "amd"
"vm-amd"
] ]
); );
default = null; default = null;

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
{}

24
systems/theia/default.nix Normal file
View file

@ -0,0 +1,24 @@
{
imports = [
./hardware.nix
./networking.nix
./overrides.nix
./services.nix
];
olympus = {
device = {
cpu = "vm-amd";
gpu = null;
};
system = {
boot = {
loader = "grub";
loadRecommendedModules = true;
enableKernelTweaks = true;
initrd.enableTweaks = true;
plymouth.enable = false;
};
};
};
}

View file

@ -0,0 +1,20 @@
{
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/09e65ff9-2195-41d8-b6a4-671c306742c3";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/FED3-A372";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
};
swapDevices = [
{
device = "/var/lib/swapfile";
size = 16 * 1024;
}
];
}

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1,53 @@
{
lib,
pkgs,
config,
modulesPath,
...
}: let
inherit (lib.modules) mkForce;
in {
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
config = {
services = {
smartd.enable = mkForce false; # Unavailable - device lacks SMART capability.
qemuGuest.enable = true;
};
systemd.services.qemu-guest-agent.path = [pkgs.shadow];
system.stateVersion = mkForce "25.04";
boot = {
kernelParams = ["net.ifnames=0"];
kernel.sysctl = {
"net.ipv4.ip_forward" = true;
"net.ipv6.conf.all.forwarding" = true;
};
initrd = {
availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"ahci"
"sr_mod"
"virtio_blk"
];
kernelModules = ["dm-snapshot"];
};
loader.grub = {
enable = true;
useOSProber = mkForce false;
efiSupport = mkForce false;
enableCryptodisk = false;
theme = mkForce null;
backgroundColor = mkForce null;
splashImage = mkForce null;
device = mkForce "/dev/vda";
};
};
};
}

View file

@ -0,0 +1 @@
{}