From a9a5c4bd1ef7a2db264dddd1dc51ac315ddbb606 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Tue, 5 Jan 2021 16:44:00 -0700 Subject: Automatically filter out `default` line from loader.conf after NixOS activation --- flake.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 4513495..41035d6 100644 --- a/flake.nix +++ b/flake.nix @@ -80,7 +80,12 @@ ]; }; - nixos = base: custom base.config.system.build.toplevel "$PROFILE/bin/switch-to-configuration switch"; + nixos = base: custom base.config.system.build.toplevel '' + $PROFILE/bin/switch-to-configuration switch + + # https://github.com/serokell/deploy-rs/issues/31 + sed -i '/^default /d' /boot/loader/loader.conf + ''; noop = base: custom base ":"; }; -- cgit v1.2.3 From 1021191b90f31fe34592a1ee95a5d588a2d61dc2 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Wed, 6 Jan 2021 22:07:02 -0700 Subject: Use boot path from configuration and ignore failures when updating loader conf --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 41035d6..e7afbdd 100644 --- a/flake.nix +++ b/flake.nix @@ -84,7 +84,7 @@ $PROFILE/bin/switch-to-configuration switch # https://github.com/serokell/deploy-rs/issues/31 - sed -i '/^default /d' /boot/loader/loader.conf + sed -i '/^default /d' ${base.config.boot.loader.efi.efiSysMountPoint}/loader/loader.conf || : ''; noop = base: custom base ":"; -- cgit v1.2.3 From 330a73e329caa1c1b320b67b1b35fb5448223a31 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Fri, 8 Jan 2021 14:45:10 -0700 Subject: Check if systemd-boot is enabled before attempting to delete default entry line --- flake.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index e7afbdd..368e627 100644 --- a/flake.nix +++ b/flake.nix @@ -84,7 +84,9 @@ $PROFILE/bin/switch-to-configuration switch # https://github.com/serokell/deploy-rs/issues/31 - sed -i '/^default /d' ${base.config.boot.loader.efi.efiSysMountPoint}/loader/loader.conf || : + ${with base.config.boot.loader; + pkgs.lib.optionalString systemd-boot.enable + "sed -i '/^default /d' ${efi.efiSysMountPoint}/loader/loader.conf"} ''; noop = base: custom base ":"; -- cgit v1.2.3