-
-
Save LnL7/264d3730ddc5c57cfdf7b4b0c1185e7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
callPackage = pkgs.lib.callPackageWith { foo = 1; }; | |
bar = 2; | |
baz = 3; | |
in | |
{ | |
x = callPackage ({ foo }: foo) {}; | |
y = callPackage ({ bar }: bar) { bar = bar; }; | |
z = callPackage ({ baz }: baz) {}; | |
} | |
# nix-instantiate --eval foo.nix -A x | |
# 1 | |
# nix-instantiate --eval foo.nix -A y | |
# 2 | |
# nix-instantiate --eval foo.nix -A z | |
# error: anonymous function at foo.nix:12:20 called without required argument 'baz' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment