Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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#i...



I’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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: