This commit is contained in:
iFargle 2023-10-04 22:15:49 +09:00
parent 914982bbd6
commit eda2899a46
2 changed files with 55 additions and 35 deletions

View file

@ -1,5 +1,7 @@
{ config, lib, pkgs, modulesPath, desktop, username, ... }: {
imports = [
# This machine won't be using secureboot
../../common/modules/boot.nix
./disks.nix
];
nixpkgs.config.allowUnfree = false;

View file

@ -1,39 +1,57 @@
{
boot.loader.grub.device = "/dev/vda";
boot.initrd.luks.devices."vda2".device = "/dev/vda2";
disko.devices = {
disk = {
vda = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "100M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";
disko.devices.disk.vda = {
device = "/dev/vda";
content = {
type = "table";
format = "gpt";
partitions = [
{
name = "BOOT";
start = "0%";
end = "550MiB";
bootable = true;
flags = [ "esp" ];
fs-type = "fat32";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
};
};
};
}
} # partition 1 (ESP)
{
name = "LUKS";
start = "550MiB";
end = "100%";
content = {
type = "luks";
name = "ROOT";
extraOpenArgs = [ "--allow-discards" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
}; # subvolumes
}; # content.content
}; # content
} # partition 2 (/ BTRFS)
]; # partitions
}; # content
}; # disko.devices.disk.vda
} # root