summary refs log tree commit diff
path: root/pkgs/tools/misc/grub/2.0x.nix
diff options
context:
space:
mode:
authorMatthias Devlamynck <matthias.devlamynck@mailoo.org>2020-10-08 11:49:18 +0200
committerMatthias Devlamynck <matthias.devlamynck@mailoo.org>2021-02-03 12:41:01 +0100
commitb3792f925a6d5eb44667bf5db25367cb3d79aceb (patch)
treec2cfcf094339a34e46ee7446aeb1d734af37efa8 /pkgs/tools/misc/grub/2.0x.nix
parente1722a6d58b8c656fc01e3131481f2bb2ee95866 (diff)
downloadnixpkgs-b3792f925a6d5eb44667bf5db25367cb3d79aceb.tar
nixpkgs-b3792f925a6d5eb44667bf5db25367cb3d79aceb.tar.gz
nixpkgs-b3792f925a6d5eb44667bf5db25367cb3d79aceb.tar.bz2
nixpkgs-b3792f925a6d5eb44667bf5db25367cb3d79aceb.tar.lz
nixpkgs-b3792f925a6d5eb44667bf5db25367cb3d79aceb.tar.xz
nixpkgs-b3792f925a6d5eb44667bf5db25367cb3d79aceb.tar.zst
nixpkgs-b3792f925a6d5eb44667bf5db25367cb3d79aceb.zip
grub2: fix grub-kbdcomp
The grub-kbdcomp command was calling ckbcomp directly without patching
to provide its path in the nix store.
Diffstat (limited to 'pkgs/tools/misc/grub/2.0x.nix')
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index bc933312afc..b97d086b972 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -1,10 +1,12 @@
 { lib, stdenv, fetchgit, flex, bison, python3, autoconf, automake, gnulib, libtool
 , gettext, ncurses, libusb-compat-0_1, freetype, qemu, lvm2, unifont, pkg-config
 , fuse # only needed for grub-mount
+, runtimeShell
 , zfs ? null
 , efiSupport ? false
 , zfsSupport ? false
 , xenSupport ? false
+, kbdcompSupport ? false, ckbcomp
 }:
 
 with lib;
@@ -53,6 +55,13 @@ stdenv.mkDerivation rec {
     ./fix-bash-completion.patch
   ];
 
+  postPatch = if kbdcompSupport then ''
+    sed -i util/grub-kbdcomp.in -e 's@\bckbcomp\b@${ckbcomp}/bin/ckbcomp@'
+  '' else ''
+    echo '#! ${runtimeShell}' > util/grub-kbdcomp.in
+    echo 'echo "Compile grub2 with { kbdcompSupport = true; } to enable support for this command."' >> util/grub-kbdcomp.in
+  '';
+
   nativeBuildInputs = [ bison flex python3 pkg-config autoconf automake ];
   buildInputs = [ ncurses libusb-compat-0_1 freetype gettext lvm2 fuse libtool ]
     ++ optional doCheck qemu