Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,21 @@ in
expected = npins.nixpkgs.outPath;
};

introspection.test-follow-sub-npins-with-inputs-input-with-source-arg = {
# s: my-lib.inputs.nixpkgs.follows = "with-inputs-dep/nixpkgs" → traverse native inputs
expr =
(with-inputs
{
my-lib = mkSrc ./fixtures/fake-flake;
with-inputs-dep = mkSrc ./fixtures/with-inputs-flake;
}
{
my-lib = s: { inputs.nixpkgs.follows = "with-inputs-dep/nixpkgs2"; };
}
).my-lib.inputs.nixpkgs.outPath;
expected = npins.nixpkgs.outPath;
};

real-flakes.test-npins-nix-maid-nixosModules-output-is-readable = {
expr =
(with-inputs npins { } (inputs: {
Expand Down
6 changes: 2 additions & 4 deletions with-inputs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ let
hostName: subName:
let
entry = inputs.${hostName} or null;
getSubInput = e: if builtins.isAttrs e && e ? inputs then e.inputs.${subName} or null else null;
in
if entry != null && builtins.isAttrs entry && entry ? inputs then
entry.inputs.${subName} or null
else
null;
getSubInput (if builtins.isFunction entry then (entry sources.${hostName}) else entry);

# Resolve an inputs entry to an actual input value, or null if unresolvable.
# Values with outPath but no _type go through mkInput so their flake.nix is loaded.
Expand Down
Loading