aboutsummaryrefslogtreecommitdiff
path: root/nix/modules/sda-simple.nix
blob: 1513d822c3a7ae189fb2232744e5fd8285d06340 (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
{ config, lib, ... }:
{
  options.monorepo.vars.disk = lib.mkOption {
    type = lib.types.str;
    default = "/dev/sda";
    example = "/dev/nvme0n1";
    description = "Disk to install NixOS to";
  };

  config.disko.devices = {
    disk = {
      my-disk = {
        device = config.monorepo.vars.disk;
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              size = "500M";
              priority = 1;
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = [ "umask=0077" ];
              };
            };
            root = {
              size = "100%";
              priority = 2;
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}