[Nix-dev] easiest way to create a derivation which is just a directory with files

Mathijs Kwik mathijs at bluescreen303.nl
Tue Aug 28 20:46:34 CEST 2012


On Tue, Aug 28, 2012 at 8:08 PM, Marc Weber <marco-oweber at gmx.de> wrote:
> Excerpts from Mathijs Kwik's message of Tue Aug 28 18:14:07 +0200 2012:
>> I have a bunch of files created with pkgs.writeText.
>
> writeText => you can specify the target location such as $out/bin/x or
> $out/share/foo
>
> => how to turn them into one directory?
>
> mkDerivation {
>  name = "x";
>  phases = "installPhase";
>
>  derivationsToLink = [ fileA fileB ];
>
>  installPhase = ''
>    ensureDir $out
>    for i in $derivationsToLink;
>     mkdir -p ..
>     cp $i $out/ ..
>    done
>  '';
> }
>
> well - this derivation already exists, its called buildEnv and is very
> very similar to what nix-env does..
>
>> I would like to bundle them into 1 derivation, so I can run buildEnv
>> on a few of these dirs to merge them.
> Alternative -> wiki "how to keep multiple packages up to date easily" or such.
> That's using buildEnv like stuff, too.
>
> There was yet another function using xorg tool to build symlinks - but
> it does not matter anymore cause you got enough pointers now.

Cool, thanks.
I'm doing something similar now, but I wasn't sure this was the way to go :)

>
> Marc Weber
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list