From 1d416595adfc7d48ef06ee49ffd2d9efee2c8859 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 1 Aug 2023 19:18:48 -0400 Subject: [PATCH] nixos/grub: Remove `with` with broad scopes. There is only other `with` with a somewhat broad scope, `with pkgs`, but it's used in a place where it would become awkward to change out. And anyway its scope is rather limited still. --- .../modules/system/boot/loader/grub/grub.nix | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 120e7f331534..468f701ae5bc 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -1,8 +1,32 @@ { config, options, lib, pkgs, ... }: -with lib; - let + inherit (lib) + all + concatMap + concatMapStrings + concatStrings + concatStringsSep + escapeShellArg + flip + foldr + forEach + hasPrefix + mapAttrsToList + literalExpression + makeBinPath + mkDefault + mkIf + mkMerge + mkOption + mkRemovedOptionModule + mkRenamedOptionModule + optional + optionals + optionalString + replaceStrings + types + ; cfg = config.boot.loader.grub; @@ -150,7 +174,7 @@ in (as opposed to external files) will be copied into the Nix store, and will be visible to all local users. ''; - type = with types; attrsOf (submodule { + type = types.attrsOf (types.submodule { options = { hashedPasswordFile = mkOption { example = "/path/to/file";