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 = {
archive = { };
external-hdd = { };
laptop-ssd = { };
};
}

View File

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

View File

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