Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 75666aad62b1
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 17da58accadc
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 3, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    GovanifY GovanifY
    Copy the full SHA
    771ba47 View commit details

Commits on Jan 23, 2021

  1. Merge pull request #108242 from GovanifY/grub-additional

    boot.loader.grub: add extraInstallCommands option
    Mic92 authored Jan 23, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    17da58a View commit details
Showing with 21 additions and 1 deletion.
  1. +21 −1 nixos/modules/system/boot/loader/grub/grub.nix
22 changes: 21 additions & 1 deletion nixos/modules/system/boot/loader/grub/grub.nix
Original file line number Diff line number Diff line change
@@ -327,6 +327,26 @@ in
'';
};

extraInstallCommands = mkOption {
default = "";
example = literalExample ''
# the example below generates detached signatures that GRUB can verify
# https://www.gnu.org/software/grub/manual/grub/grub.html#Using-digital-signatures
''${pkgs.findutils}/bin/find /boot -not -path "/boot/efi/*" -type f -name '*.sig' -delete
old_gpg_home=$GNUPGHOME
export GNUPGHOME="$(mktemp -d)"
''${pkgs.gnupg}/bin/gpg --import ''${priv_key} > /dev/null 2>&1
''${pkgs.findutils}/bin/find /boot -not -path "/boot/efi/*" -type f -exec ''${pkgs.gnupg}/bin/gpg --detach-sign "{}" \; > /dev/null 2>&1
rm -rf $GNUPGHOME
export GNUPGHOME=$old_gpg_home
'';
type = types.lines;
description = ''
Additional shell commands inserted in the bootloader installer
script after generating menu entries.
'';
};

extraPerEntryConfig = mkOption {
default = "";
example = "root (hd0)";
@@ -715,7 +735,7 @@ in
${optionalString cfg.enableCryptodisk "export GRUB_ENABLE_CRYPTODISK=y"}
'' + flip concatMapStrings cfg.mirroredBoots (args: ''
${pkgs.perl}/bin/perl ${install-grub-pl} ${grubConfig args} $@
''));
'') + cfg.extraInstallCommands);

system.build.grub = grub;