aboutsummaryrefslogtreecommitdiff
path: root/tharos/boot.nix
blob: 1843e63e8061e3d221040993920b6f38c3836b2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ inputs, ... }:
{
  flake.machines.tharos = {
    nixos =
      {
        modulesPath,
        ...
      }:
      {
        imports = [
          inputs.disko.nixosModules.default
          "${modulesPath}/profiles/qemu-guest.nix"
        ];
        disko.devices.disk.main = {
          device = "/dev/vda";
          type = "disk";
          content = {
            type = "gpt";
            partitions = {
              # Die KVM läuft auf SeaBIOS, daher muss es hier eine MBR-Partition sein
              boot = {
                size = "1M";
                type = "EF02";
              };
              root = {
                size = "100%";
                content = {
                  type = "filesystem";
                  format = "ext4";
                  mountpoint = "/";
                };
              };
            };
          };
        };

        /*
          ANMERKUNG: Erhalten durch:

          nix run .#machines.infect-tharos -- --no-reboot --generate-hardware-config nixos-hardware-config <datei>
        */
        boot.initrd.availableKernelModules = [
          "ata_piix"
          "uhci_hcd"
          "virtio_pci"
          "virtio_blk"
        ];
        boot.kernelModules = [ "kvm-amd" ];
      };
  };
}