hosts/ni: add disko device config

This commit is contained in:
Gabriel Arazas 2023-06-30 13:38:22 +08:00
parent 6c7939e7da
commit 9af237e242
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 52 additions and 16 deletions

View File

@ -38,6 +38,10 @@ in
})
];
disko.devices = import ./disko.nix {
disks = [ "/dev/nvme0n1" ];
};
services.openssh.hostKeys = [{
path = config.sops.secrets."ni/ssh-key".path;
type = "ed25519";

48
hosts/ni/disko.nix Normal file
View File

@ -0,0 +1,48 @@
{ disks ? [ "/dev/nvme0n1" ], ... }:
{
disk.nvme0n1 = {
device = builtins.elemAt disks 0;
type = "disk";
content = {
format = "gpt";
type = "table";
partitions = [
{
name = "root";
start = "512MiB";
end = "-8GiB";
part-type = "primary";
content = {
type = "filesystem";
mountpoint = "/";
format = "ext4";
};
}
{
name = "ESP";
start = "0";
end = "512MiB";
bootable = true;
content = {
type = "filesystem";
mountpoint = "/boot";
format = "vfat";
};
}
{
name = "swap";
start = "-8GiB";
end = "100%";
part-type = "primary";
content = {
type = "swap";
randomEncryption = true;
};
}
];
};
};
}

View File

@ -42,22 +42,6 @@
};
boot.loader.efi.canTouchEfiVariables = true;
fileSystems."/" = {
label = "root";
options = [
"defaults"
"noatime"
];
fsType = "ext4";
};
fileSystems."/boot" = {
label = "boot";
fsType = "vfat";
};
swapDevices = [{ label = "swap"; }];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault true;