4 ms·
What resources led you to try: default.nix (i'm guessing): derivation { name = "simple"; builder = "${bash}/bin/bash"; args = [ ./simple
by ParetoOptimal 5y ago
What resources led you to try:
default.nix (i'm guessing):
derivation {
name = "simple";
builder = "${bash}/bin/bash";
args = [ ./simple_builder.sh ];
inherit gcc coreutils;
src = ./simple.c;
system = builtins.currentSystem;
}
Command:
nix-build -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'
Rather than something like this[0]:
default.nix:
with (import <nixpkgs> {});
derivation {
name = "simple";
builder = "${bash}/bin/bash";
args = [ ./simple_builder.sh ];
inherit gcc coreutils;
src = ./simple.c;
system = builtins.currentSystem;
}
Which can be built with:
nix build
We should fix the docs that led your version rather than the second.
0: https://nixos.org/guides/nix-pills/working-derivation.html#idm140737320270416 https://nixos.org/guides/nix-pills/working-derivation.html#i...
- scintill76 5y agoI’m an intermediate Nix user - aren’t pkgs usually passed in as an argument so that the caller can choose them? I sort of accepted that verbose command line as a necessary evil of good design.