diff --git a/hosts/pbx/configuration.nix b/hosts/pbx/configuration.nix index 852e654..b6ba483 100644 --- a/hosts/pbx/configuration.nix +++ b/hosts/pbx/configuration.nix @@ -1,6 +1,8 @@ -{ config, lib, pkgs, ... }: - { + config, + lib, + ... +}: { imports = [ ./disko.nix ../../users/jalr @@ -21,10 +23,10 @@ boot = { initrd = { - availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; }; - kernelModules = [ "kvm-intel" ]; + kernelModules = ["kvm-intel"]; kernelParams = [ "console=ttyS0,115200" "console=tty1" @@ -32,24 +34,26 @@ loader = { efi = { - efiSysMountPoint = "/boot/efis/disk1"; + efiSysMountPoint = "/boot"; canTouchEfiVariables = false; }; generationsDir.copyKernels = true; grub = { - devices = [ "/dev/sda" "/dev/sdb" ]; + devices = ["/dev/sda"]; efiInstallAsRemovable = true; copyKernels = true; efiSupport = true; - zfsSupport = true; + mirroredBoots = [ + { + path = "/boot1"; + devices = ["/dev/sdb"]; + } + ]; extraConfig = '' serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal_input --append serial terminal_output --append serial ''; - extraInstallCommands = '' - ${pkgs.coreutils-full}/bin/cp -r ${config.boot.loader.efi.efiSysMountPoint}/EFI /boot/efis/disk2 - ''; }; }; }; diff --git a/hosts/pbx/disko.nix b/hosts/pbx/disko.nix index 30a34be..7f88496 100644 --- a/hosts/pbx/disko.nix +++ b/hosts/pbx/disko.nix @@ -7,10 +7,20 @@ type = "filesystem"; format = "vfat"; inherit mountpoint; - mountOptions = [ - "uid=0" "gid=0" "fmask=0077" "dmask=0077" - "nodev" "nosuid" "noexec" - "x-systemd.idle-timeout=1min" "x-systemd.automount" "noauto" "nofail" "noatime" "X-mount.mkdir" + mountOptions = [ + "uid=0" + "gid=0" + "fmask=0077" + "dmask=0077" + "nodev" + "nosuid" + "noexec" + "x-systemd.idle-timeout=1min" + "x-systemd.automount" + "noauto" + "nofail" + "noatime" + "X-mount.mkdir" ]; }; }; @@ -27,7 +37,7 @@ in { size = "1M"; type = "EF02"; # for grub MBR }; - ESP = mkEfiPartition "/boot/efis/disk1"; + ESP = mkEfiPartition "/boot"; nixos = { size = "100%"; }; @@ -44,16 +54,17 @@ in { size = "1M"; type = "EF02"; # for grub MBR }; - ESP = mkEfiPartition "/boot/efis/disk2"; + ESP = mkEfiPartition "/boot1"; nixos = { size = "100%"; - content = let + content = let thisPartition = cfg.devices.disk.disk2.content.partitions.nixos.device; mirror = cfg.devices.disk.disk1.content.partitions.nixos.device; in { type = "btrfs"; extraArgs = [ "-f" + "-m raid1" "-d raid1" "${mirror}" ]; @@ -66,23 +77,23 @@ in { subvolumes = { "/root" = { mountpoint = "/"; - mountOptions = ["compress-force=zstd:1" "noatime"]; + mountOptions = ["degraded" "compress-force=zstd:1" "noatime"]; }; "/home" = { mountpoint = "/home"; - mountOptions = ["compress-force=zstd:1" "noatime" "nodev" "nosuid"]; + mountOptions = ["degraded" "compress-force=zstd:1" "noatime" "nodev" "nosuid"]; }; "/nix" = { mountpoint = "/nix"; - mountOptions = ["compress-force=zstd:1" "noatime" "nodev"]; + mountOptions = ["degraded" "compress-force=zstd:1" "noatime" "nodev"]; }; "/log" = { mountpoint = "/var/log"; - mountOptions = ["compress-force=zstd:1" "noatime" "nodev" "nosuid"]; + mountOptions = ["degraded" "compress-force=zstd:1" "noatime" "nodev" "nosuid"]; }; "/persist" = { mountpoint = "/persist"; - mountOptions = ["compress-force=zstd:1" "noatime" "nodev" "nosuid"]; + mountOptions = ["degraded" "compress-force=zstd:1" "noatime" "nodev" "nosuid"]; }; }; }; diff --git a/modules/nix.nix b/modules/nix.nix index 1333d21..352d31a 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -47,5 +47,6 @@ environment.systemPackages = with pkgs; [ cached-nix-shell + git ]; }