summaryrefslogtreecommitdiff
path: root/hosts/omega-relay/disko.nix
blob: 307f6ded54c8f5d3e93e3fde601f9ae920de6299 (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
52
53
{ config, lib, ... }:
{
  config = lib.mkIf (!config.addons.virtualisation.isTestVM) ({
    services.btrfs.autoScrub = {
      enable = true;
      interval = "weekly";
    };

    boot.loader.grub.device = "/dev/sda";
    # Workaround
    boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
    boot.loader.efi.canTouchEfiVariables = false;

    # TODO: Mount points

    # Disko for formatting
    disko.devices = {
      disk = {
        main-disk = {
          device = "/dev/sda";
          type = "disk";
          content = {
            type = "gpt";
            partitions = {
              BOOT = {
                type = "EF02";
                size = "1M";
              };
              ESP = {
                type = "EF00";
                size = "128M";
                content = {
                  type = "filesystem";
                  format = "vfat";
                  mountpoint = "/boot";
                  mountOptions = [ "umask=0077" ];
                };
              };
              root = {
                size = "100%";
                content = {
                  type = "filesystem";
                  format = "btrfs";
                  mountpoint = "/";
                };
              };
            };
          };
        };
      };
    };
  });
}