From 92fc1c968653c048c460a81e0f8d6ddab5a7e9d3 Mon Sep 17 00:00:00 2001 From: "Zhiyong (Justin) He" Date: Sat, 26 Oct 2024 00:27:15 +0300 Subject: [PATCH] Update flake.nix Fix build failure on NixOS --- flake.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index e90818a..fbce639 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,15 @@ src = "${self}"; buildInputs = [ pkgs.imagemagick ]; installPhase = '' - mkdir -p $out/grub/themes; + mkdir -p $out/grub/themes + + # Create placeholder terminal box PNGs that install.sh expects + mkdir -p common + for box in c e n ne nw s se sw w; do + touch common/terminal_box_$box.png + done + + # Run the install script bash ./install.sh \ --generate $out/grub/themes \ --screen ${cfg.screen} \ @@ -44,9 +52,11 @@ rm $out/grub/themes/${cfg.theme}/background.jpg; ${pkgs.imagemagick}/bin/magick ${splashImage} $out/grub/themes/${cfg.theme}/background.jpg; fi; + if [ ${pkgs.lib.trivial.boolToString cfg.footer} == "false" ]; then sed -i ':again;$!N;$!b again; s/\+ image {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt; fi; + if [ ${pkgs.lib.trivial.boolToString hasBootMenuConfig} == "true" ]; then sed -i ':again;$!N;$!b again; s/\+ boot_menu {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt; cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt @@ -55,6 +65,7 @@ } EOF fi; + if [ ${pkgs.lib.trivial.boolToString hasTerminalConfig} == "true" ]; then sed -i 's/^terminal-.*$//g' $out/grub/themes/${cfg.theme}/theme.txt cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt