From 3aba5f813f77e94f3f05ea1fd10f15518b82bf13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Tue, 3 Nov 2020 13:33:52 +0100 Subject: grub2: fix bug where superusers are always set --- modules/grub2/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/grub2/default.nix b/modules/grub2/default.nix index d2da4dd6cf0f..bc8280dec26e 100644 --- a/modules/grub2/default.nix +++ b/modules/grub2/default.nix @@ -10,15 +10,16 @@ let "fallback/payload"; configText = (readFile ./files/grub.cfg) + + cfg.extraConfig + (optionalString (cfg.scanDevices) (readFile ./files/grub-scan.cfg)) + - (optionalString (cfg.users != {}) + (optionalString (cfg.users != {}) ( (concatStringsSep "\n" (mapAttrsToList (n: u: '' ${if u.passwordIsHashed then "password_pbkdf2" else "password"} ${n} ${u.password} '') cfg.users)) + '' set superusers="${concatStringsSep " " (attrNames (filterAttrs (n: u: u.superuser) cfg.users))}" export superusers '' - ) + + )) + (optionalString cfg.generateSecondaryPayloadEntries ( concatMapStrings (n: '' menuentry '${removePrefix "img/" n}' { -- cgit v1.2.3