Nixpkgs: Can we make it easier to make a derivation with no source?

Created on 23 Feb 2017  路  3Comments  路  Source: NixOS/nixpkgs

If you call mkDerivation without specifying src or srcs, it fails to build with

variable $src or $srcs should point to the source

Sometimes I want to make a derivation that has no source, like if it only needs to combine things from other derivations.

I usually resort to

src = builtins.filterSource (path: type: false) ./.;

Is there some more convenient way to do this?

question

Most helpful comment

You could pass unpackPhase = "true";. In other cases an option might be pkgs.runCommand.

All 3 comments

You could pass unpackPhase = "true";. In other cases an option might be pkgs.runCommand.

You can also configure what phases should run for a derivation, but I think using a noop for the unpackPhase is generally a better solution. eg. phases = [ "installPhase" "fixupPhase" ];

I think the question has been answered so I am closing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

copumpkin picture copumpkin  路  3Comments

langston-barrett picture langston-barrett  路  3Comments

tomberek picture tomberek  路  3Comments

vaibhavsagar picture vaibhavsagar  路  3Comments

spacekitteh picture spacekitteh  路  3Comments