fix(lib): accept extra snowfall args

Snowfall mkLib/mkFlake imports all submodules with a shared argument set, so narrow lambdas crash when snowfall-config is present. Allow extra args and add an evaluation check to catch regressions during flake checks.
This commit is contained in:
anntnzrb
2026-02-05 01:21:12 -05:00
committed by mjallen18
parent 70ad5e14ae
commit 3a0e52e0b9
7 changed files with 25 additions and 1 deletions

View File

@@ -87,6 +87,25 @@
formatter = eachSystemMap systems (system: treefmtEval.${system}.config.build.wrapper); formatter = eachSystemMap systems (system: treefmtEval.${system}.config.build.wrapper);
# Regression check: force snowfall-lib evaluation so unexpected-arg errors fail in `nix flake check`.
checks = eachSystemMap systems (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
lib = mkLib {
src = self;
inputs = inputs // {
self = { };
};
};
eval = builtins.tryEval (builtins.attrNames lib.snowfall);
in
assert eval.success;
{
snowfall-lib-eval = pkgs.runCommand "snowfall-lib-eval" { } "mkdir -p $out";
}
);
snowfall = rec { snowfall = rec {
raw-config = config; raw-config = config;

View File

@@ -1,5 +1,6 @@
{ {
core-inputs, core-inputs,
...
}: }:
let let
inherit (core-inputs.nixpkgs.lib) inherit (core-inputs.nixpkgs.lib)

View File

@@ -1,5 +1,6 @@
{ {
snowfall-lib, snowfall-lib,
...
}: }:
{ {
check = { check = {

View File

@@ -1,5 +1,6 @@
{ {
core-inputs, core-inputs,
...
}: }:
let let
inherit (core-inputs.nixpkgs.lib) id foldr flip; inherit (core-inputs.nixpkgs.lib) id foldr flip;

View File

@@ -1,6 +1,7 @@
{ {
core-inputs, core-inputs,
snowfall-lib, snowfall-lib,
...
}: }:
let let
inherit (builtins) inherit (builtins)

View File

@@ -1,5 +1,6 @@
{ {
snowfall-lib, snowfall-lib,
...
}: }:
{ {
shell = { shell = {

View File

@@ -1,6 +1,6 @@
{ {
core-inputs,
snowfall-lib, snowfall-lib,
...
}: }:
let let