From be638b274dd2897bbe34ce098f250d98295f0451 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Sun, 14 Apr 2024 11:35:47 +0200 Subject: [PATCH] systemd-boot: copy the entire bootloader to the second disc on every switch --- hosts/quitte/configuration.nix | 9 +++++++-- hosts/quitte/hardware-configuration.nix | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hosts/quitte/configuration.nix b/hosts/quitte/configuration.nix index f86ad6e..8b05df1 100644 --- a/hosts/quitte/configuration.nix +++ b/hosts/quitte/configuration.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, pkgs, ... }: { imports = @@ -7,7 +7,12 @@ ./network.nix ]; - boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot = { + enable = true; + extraInstallCommands = '' + ${pkgs.coreutils}/bin/cp -r /boot/* /boot2 + ''; + }; # boot.kernelParams = [ "video=VGA-1:1024x768@30" ]; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = [ "zfs" ]; diff --git a/hosts/quitte/hardware-configuration.nix b/hosts/quitte/hardware-configuration.nix index 52d637e..d8afd10 100644 --- a/hosts/quitte/hardware-configuration.nix +++ b/hosts/quitte/hardware-configuration.nix @@ -45,6 +45,11 @@ device = "/dev/disk/by-uuid/3278-8D00"; fsType = "vfat"; }; + fileSystems."/boot2" = + { + device = "/dev/disk/by-uuid/3366-F71E"; + fsType = "vfat"; + }; swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";