mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
slightly saner multi-efi setup
This commit is contained in:
parent
ed20ccf64d
commit
46ac5bc156
3 changed files with 92 additions and 101 deletions
|
|
@ -1,45 +1,24 @@
|
|||
{disko, ...}: {lib, ...}: let
|
||||
disks = [
|
||||
"nvme-SHPP41-500GM_SSB4N6719101A4N22"
|
||||
"nvme-SHPP41-500GM_SSB4N6719101A4N0E"
|
||||
];
|
||||
in {
|
||||
{disko, ...}: {...}: {
|
||||
imports = [disko.nixosModules.disko];
|
||||
disko.devices = {
|
||||
disk = lib.mkMerge (map (x: {
|
||||
${x} = {
|
||||
disk = {
|
||||
"0E" = {
|
||||
type = "disk";
|
||||
|
||||
device = "/dev/disk/by-id/${x}";
|
||||
device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
name = "boot";
|
||||
name = "BOOT";
|
||||
start = "0";
|
||||
end = "1M";
|
||||
part-type = "primary";
|
||||
flags = ["bios_grub"];
|
||||
}
|
||||
{
|
||||
name = "ESP";
|
||||
start = "1M";
|
||||
end = "1G";
|
||||
end = "4G";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot/efis/${x}";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zfsboot";
|
||||
start = "1G";
|
||||
end = "5G";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "bpool";
|
||||
mountpoint = "/efi0E";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
|
@ -52,7 +31,7 @@ in {
|
|||
};
|
||||
}
|
||||
{
|
||||
name = "zfsroot";
|
||||
name = "zfsroot ";
|
||||
start = "21G";
|
||||
end = "100%";
|
||||
content = {
|
||||
|
|
@ -63,8 +42,47 @@ in {
|
|||
];
|
||||
};
|
||||
};
|
||||
})
|
||||
disks);
|
||||
"22" = {
|
||||
type = "disk";
|
||||
|
||||
device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
name = "BOOT";
|
||||
start = "0";
|
||||
end = "4G";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/efi22";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "swap";
|
||||
start = "5G";
|
||||
end = "21G";
|
||||
content = {
|
||||
type = "swap";
|
||||
randomEncryption = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zfsroot ";
|
||||
start = "21G";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "rpool";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
rpool = {
|
||||
type = "zpool";
|
||||
|
|
@ -118,33 +136,6 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
bpool = {
|
||||
type = "zpool";
|
||||
mode = "mirror";
|
||||
rootFsOptions = {
|
||||
acltype = "posixacl";
|
||||
compression = "lz4";
|
||||
devices = "off";
|
||||
normalization = "formD";
|
||||
relatime = "on";
|
||||
xattr = "sa";
|
||||
canmount = "off";
|
||||
};
|
||||
|
||||
options = {
|
||||
compatibility = "grub2";
|
||||
ashift = "12";
|
||||
autotrim = "on";
|
||||
};
|
||||
datasets = {
|
||||
"boot" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/boot";
|
||||
postCreateHook = "zfs snapshot bpool/boot@empty";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
_file = ./disko.nix;
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@
|
|||
boot = {
|
||||
kernelModules = ["amdgpu"];
|
||||
initrd = {
|
||||
systemd.enable = true;
|
||||
availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"];
|
||||
includeDefaultModules = false;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ _: {
|
|||
};
|
||||
#make sure the sopskey is found
|
||||
sops.age.sshKeyPaths = lib.mkForce ["/persist/ssh/ssh_host_ed25519_key"];
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
fileSystems = {
|
||||
"/persist".neededForBoot = true;
|
||||
"/efi22".options = ["nofail"];
|
||||
"/efi0E".options = ["nofail"];
|
||||
};
|
||||
boot = {
|
||||
zfs = {
|
||||
devNodes = "/dev/disk/by-id/";
|
||||
|
|
@ -41,25 +45,20 @@ _: {
|
|||
plymouth.enable = false;
|
||||
loader = {
|
||||
generationsDir.copyKernels = true;
|
||||
|
||||
#override defaults
|
||||
#override default
|
||||
systemd-boot.enable = false;
|
||||
efi.canTouchEfiVariables = false;
|
||||
|
||||
grub = {
|
||||
enable = true;
|
||||
efiInstallAsRemovable = true;
|
||||
copyKernels = true;
|
||||
efiSupport = true;
|
||||
zfsSupport = true;
|
||||
mirroredBoots = [
|
||||
{
|
||||
path = "/boot/efis/nvme-SHPP41-500GM_SSB4N6719101A4N0E";
|
||||
devices = ["/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E"];
|
||||
path = "/efi22";
|
||||
devices = ["nodev"];
|
||||
}
|
||||
{
|
||||
path = "/boot/efis/nvme-SHPP41-500GM_SSB4N6719101A4N22";
|
||||
devices = ["/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22"];
|
||||
path = "/efi0E";
|
||||
devices = ["nodev"];
|
||||
}
|
||||
];
|
||||
splashImage = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue