diskoConfigs/laptop-ssd: init

This commit is contained in:
Gabriel Arazas 2024-11-21 11:51:25 +08:00
parent ae551d64c7
commit 2cef0d1dba
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
4 changed files with 91 additions and 57 deletions

View File

@ -0,0 +1,30 @@
{ disk ? "/dev/nvme1n1", prefix ? "ni", ... }:
{
disko.devices = {
disk."${prefix}-secondary" = {
device = disk;
type = "disk";
content = {
type = "gpt";
partitions = {
data = {
size = "100%";
type = "8300";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountOptions = [ "compress=zstd:10" ];
mountpoint = "/";
};
};
};
};
};
};
};
};
}

View File

@ -4,5 +4,6 @@
setups.disko.configs = { setups.disko.configs = {
archive = { }; archive = { };
external-hdd = { }; external-hdd = { };
laptop-ssd = { };
}; };
} }

View File

@ -57,6 +57,7 @@ in
}; };
}; };
}; };
diskoConfigs = [ "laptop-ssd" ];
}; };
# A remote server. # A remote server.

View File

@ -1,70 +1,72 @@
{ disk ? "/dev/nvme0n1", config, lib, ... }: { primaryDisk ? "/dev/nvme0n1", secondaryDisk ? null, config, lib, ... }:
{ {
disko.devices = { disko.devices = lib.mkMerge [
disk."${config.hostname}-primary" = { {
device = disk; disk."${config.networking.hostName}-primary" = {
type = "disk"; device = primaryDisk;
content = { type = "disk";
type = "gpt"; content = {
partitions = { type = "gpt";
# You can't really have a btrfs-layered boot so this'll have to do. partitions = {
ESP = { # You can't really have a btrfs-layered boot so this'll have to do.
priority = 1; ESP = {
start = "0"; priority = 1;
end = "512MiB"; start = "0";
type = "EF00"; end = "512MiB";
content = { type = "EF00";
type = "filesystem"; content = {
mountpoint = "/boot"; type = "filesystem";
format = "vfat"; mountpoint = "/boot";
format = "vfat";
};
}; };
};
swap = { swap = {
start = "-8GiB"; start = "-8GiB";
end = "-0"; end = "-0";
type = "8200"; type = "8200";
content = { content = {
type = "swap"; type = "swap";
randomEncryption = true; randomEncryption = true;
};
}; };
};
root = { root = {
size = "100%"; size = "100%";
type = "8300"; type = "8300";
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = [ "-f" ]; extraArgs = [ "-f" ];
subvolumes = lib.mkMerge [ subvolumes = lib.mkMerge [
{ {
"/root" = { "/root" = {
mountOptions = [ "compress=zstd" ]; mountOptions = [ "compress=zstd" ];
mountpoint = "/"; mountpoint = "/";
}; };
"/home" = { "/home" = {
mountOptions = [ "compress=zstd" ]; mountOptions = [ "compress=zstd" ];
mountpoint = "/home"; mountpoint = "/home";
}; };
"/nix" = { "/nix" = {
mountOptions = [ "compress=zstd" "noatime" "noacl" ]; mountOptions = [ "compress=zstd" "noatime" "noacl" ];
mountpoint = "/nix"; mountpoint = "/nix";
}; };
} }
(lib.mkIf config.services.guix.enable { (lib.mkIf config.services.guix.enable {
"/gnu" = { "/gnu" = {
mountOptions = [ "compress=zstd" "noatime" "noacl" ]; mountOptions = [ "compress=zstd" "noatime" "noacl" ];
mountpoint = "/gnu"; mountpoint = "/gnu";
}; };
}) })
]; ];
};
}; };
}; };
}; };
}; };
}; }
}; ];
} }