forgetten to appply this patch
svn path=/nixpkgs/trunk/; revision=12098
This commit is contained in:
parent
51651a4ec0
commit
74b5040479
@ -2,28 +2,43 @@
|
|||||||
# experimental
|
# experimental
|
||||||
|
|
||||||
/*
|
/*
|
||||||
# example for nix itself adding glibc tag file to an env var.
|
# example:
|
||||||
# experimental
|
# add postgresql to environment and create ctags (tagfiles can be extracted from TAG_FILES)
|
||||||
env_nix = my_environment rec {
|
# add this to your ~/.nixpkgs/config.nix
|
||||||
buildInputs = [perl curl bzip2 aterm242fixes db4]
|
|
||||||
++ map (x : sourceWithTagsDerivation ( (addCTaggingInfo x ).passthru.sourceWithTags ) ) [ glibc ];
|
devEnvs = pkgs : with pkgs; with sourceAndTags;
|
||||||
db4 = db44;
|
let simple = { name, buildInputs ? [], cTags ? [] }:
|
||||||
aterm = aterm242fixes;
|
pkgs.myEnvFun {
|
||||||
name = "env_nix";
|
inherit name stdenv;
|
||||||
userCmds = ". ~/.bashrc
|
buildInputs = buildInputs
|
||||||
PS1='\033]2;\h:\u:\w\007\\nenv ${name} \[\033[1;32m\][\u@\h: \w ]$\[\033[0m\] '
|
++ map (x : sourceWithTagsDerivation ( (addCTaggingInfo x ).passthru.sourceWithTags ) ) cTags;
|
||||||
|
extraCmds = ". ~/.bashrc; cd $PWD
|
||||||
|
# configure should find them
|
||||||
|
export LDFLAGS=$NIX_LDFLAGS
|
||||||
|
export CFLAGS=$NIX_CFLAGS_COMPILE
|
||||||
";
|
";
|
||||||
|
preBuild = "export TAG_FILES";
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
postgresql = simple {
|
||||||
|
name = "postgresql";
|
||||||
|
buildInputs = [postgresql];
|
||||||
|
cTags = [postgresql ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
Put this into your .bashrc
|
Put this into your .bashrc
|
||||||
loadEnv(){
|
loadEnv(){ . "${HOME}/.nix-profile/dev-envs/${1}" }
|
||||||
. "${HOME}/.nix-profile/dev-envs/${1}"
|
then install and
|
||||||
}
|
$ loadEnv postgresql
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
args: args.stdenv.mkDerivation (
|
args: args.stdenv.mkDerivation (
|
||||||
{ extraCmds =""; } // {
|
{ extraCmds =""; } // {
|
||||||
phases = "buildPhase";
|
phases = "buildPhase";
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
eval "$preBuild"
|
||||||
name=${args.name}
|
name=${args.name}
|
||||||
o=$out/dev-envs/$name
|
o=$out/dev-envs/$name
|
||||||
ensureDir `dirname $o`
|
ensureDir `dirname $o`
|
||||||
@ -39,6 +54,5 @@ args: args.stdenv.mkDerivation (
|
|||||||
$extraCmds
|
$extraCmds
|
||||||
echo env $name loaded
|
echo env $name loaded
|
||||||
" >> $o
|
" >> $o
|
||||||
chmod +x $o
|
|
||||||
'';
|
'';
|
||||||
} // args // { name = "${args.name}-env"; } )
|
} // args // { name = "${args.name}-env"; } )
|
||||||
|
@ -32,7 +32,8 @@ args: with args; {
|
|||||||
eval \"\$cmd\";
|
eval \"\$cmd\";
|
||||||
TAG_FILES=\"\$TAG_FILES\${TAG_FILES:+:}\$TAG_FILE\"
|
TAG_FILES=\"\$TAG_FILES\${TAG_FILES:+:}\$TAG_FILE\"
|
||||||
done
|
done
|
||||||
echo \"TAG_FILES=\\\"\\\$TAG_FILES\\\${TAG_FILES:+:}$TAG_FILES\\\"\" >> $out/nix-support
|
ensureDir $out/nix-support
|
||||||
|
echo \"TAG_FILES=\\\"\\\$TAG_FILES\\\${TAG_FILES:+:}$TAG_FILES\\\"\" >> $out/nix-support/setup-hook
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
# example usage
|
# example usage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user