From 40d284c0f9eed2f14d4059677bb5acf3949f5570 Mon Sep 17 00:00:00 2001 From: anntnzrb Date: Thu, 5 Feb 2026 16:26:47 -0500 Subject: [PATCH] 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. --- snowfall-lib/home/default.nix | 3 +-- snowfall-lib/module/default.nix | 4 ++-- snowfall-lib/overlay/default.nix | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/snowfall-lib/home/default.nix b/snowfall-lib/home/default.nix index ebd9b0b..601a205 100644 --- a/snowfall-lib/home/default.nix +++ b/snowfall-lib/home/default.nix @@ -214,8 +214,7 @@ in }; user-home-modules-list = mapAttrsToList ( - module-path: module: - args: + module-path: module: args: (module args) // { _file = "${user-homes-root}/${module-path}/default.nix"; diff --git a/snowfall-lib/module/default.nix b/snowfall-lib/module/default.nix index 3757631..5c94806 100644 --- a/snowfall-lib/module/default.nix +++ b/snowfall-lib/module/default.nix @@ -43,9 +43,9 @@ in # 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. ${metadata.name} = - args: + args@{ pkgs, ... }: let - system = args.system or args.pkgs.stdenv.hostPlatform.system; + system = args.system or pkgs.stdenv.hostPlatform.system; target = args.target or system; format = diff --git a/snowfall-lib/overlay/default.nix b/snowfall-lib/overlay/default.nix index a004ca4..3258e0b 100644 --- a/snowfall-lib/overlay/default.nix +++ b/snowfall-lib/overlay/default.nix @@ -112,7 +112,8 @@ in ${namespace} = (prev.${namespace} or { }) // user-packages; }; - create-overlay = overlays: file: + create-overlay = + overlays: file: let # 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.