[Nix-dev] Some missing build-env features

Marc Weber marco-oweber at gmx.de
Fri Oct 8 21:52:14 CEST 2010


Hi Yury,

I had in mind using env vars only earlier. I gave up on it because it
would have meant rewriting nixpkgs.

But you only want some env vars.

> 4) A package should be able to tell buildEnv about required environment 
> variables. Examples: KDEDIRS, XDG_*, *_PLUGIN_PATH etc.

KDEDIRS etc, could they be simple set by /etc/bashrc pointing to
~/.nix-profile and /var/run/current-system/sw ?


> 2) A package should be able to tell buildEnv to execute some commands after 
> symlinking dirs&files. Example: update-mime-info etc.
How should this be implemented? Would adding a
~/.nixpkgs/post-install-hook.sh suffice? It could run
~/.nix-profile/post-install-hooks/* which could be created by packages
or such.

This should be run whenever you run
  nix-env -switch-generation
  nix-env -i
etc

How would you suggest implementing this?

Excerpts from Yury G. Kudryashov's message of Fri Oct 08 16:10:07 +0200 2010:
> 1) Currently a runtime dependency must be a build time dependency as well. 
> This is bad because there are cycles.

Can you elaborate ? You didn't reply to my last reply about this issue
about creating an expression depending no both packages.
How would you describe those cycles?

What would be wrong with an implementation like this?

addRuntimeDependency pkg: runtimeDeps: =
 // now symlink pkg into $out and add runtimeDeps to
 // propagatedBuildInputs

Marc Weber



More information about the nix-dev mailing list