fix(module): preserve pkgs module arg binding

nix fmt collapsed a generated module wrapper to a plain args lambda, which broke modules expecting explicit pkgs injection during flake evaluation. Restore the named pkgs binding and keep formatter-driven rewrites from this run.
This commit is contained in:
anntnzrb
2026-02-05 16:26:47 -05:00
committed by mjallen18
parent 3a0e52e0b9
commit 40d284c0f9
3 changed files with 5 additions and 5 deletions

View File

@@ -214,8 +214,7 @@ in
}; };
user-home-modules-list = mapAttrsToList ( user-home-modules-list = mapAttrsToList (
module-path: module: module-path: module: args:
args:
(module args) (module args)
// { // {
_file = "${user-homes-root}/${module-path}/default.nix"; _file = "${user-homes-root}/${module-path}/default.nix";

View File

@@ -43,9 +43,9 @@ in
# NOTE: home-manager *requires* modules to specify named arguments or it will not # NOTE: home-manager *requires* modules to specify named arguments or it will not
# pass values in. For this reason we must specify things like `pkgs` as a named attribute. # pass values in. For this reason we must specify things like `pkgs` as a named attribute.
${metadata.name} = ${metadata.name} =
args: args@{ pkgs, ... }:
let let
system = args.system or args.pkgs.stdenv.hostPlatform.system; system = args.system or pkgs.stdenv.hostPlatform.system;
target = args.target or system; target = args.target or system;
format = format =

View File

@@ -112,7 +112,8 @@ in
${namespace} = (prev.${namespace} or { }) // user-packages; ${namespace} = (prev.${namespace} or { }) // user-packages;
}; };
create-overlay = overlays: file: create-overlay =
overlays: file:
let let
# We are building flake outputs based on file paths. Nix doesn't allow this # We are building flake outputs based on file paths. Nix doesn't allow this
# so we have to explicitly discard the string's path context to use it as an attribute name. # so we have to explicitly discard the string's path context to use it as an attribute name.