summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2008-06-15 12:00:00 +0000
committerMarc Weber <marco-oweber@gmx.de>2008-06-15 12:00:00 +0000
commit74b50404795c0220c01a873084d9942da3d4e4c0 (patch)
tree078b56244ccd38b113f2290fcccadef8a2cfdfdd /pkgs
parent51651a4ec097737f7a5b9d4460a2eebee55b15fd (diff)
downloadnixpkgs-74b50404795c0220c01a873084d9942da3d4e4c0.tar
nixpkgs-74b50404795c0220c01a873084d9942da3d4e4c0.tar.gz
nixpkgs-74b50404795c0220c01a873084d9942da3d4e4c0.tar.bz2
nixpkgs-74b50404795c0220c01a873084d9942da3d4e4c0.tar.lz
nixpkgs-74b50404795c0220c01a873084d9942da3d4e4c0.tar.xz
nixpkgs-74b50404795c0220c01a873084d9942da3d4e4c0.tar.zst
nixpkgs-74b50404795c0220c01a873084d9942da3d4e4c0.zip
forgetten to appply this patch
svn path=/nixpkgs/trunk/; revision=12098
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/misc/my_env/default.nix48
-rw-r--r--pkgs/misc/source-and-tags/default.nix3
2 files changed, 33 insertions, 18 deletions
diff --git a/pkgs/misc/my_env/default.nix b/pkgs/misc/my_env/default.nix
index bd1726039ca..9853041832d 100644
--- a/pkgs/misc/my_env/default.nix
+++ b/pkgs/misc/my_env/default.nix
@@ -2,28 +2,43 @@
 # experimental
 
 /*
-  # example for nix itself adding glibc tag file to an env var.
-  # experimental
-  env_nix = my_environment rec {
-   buildInputs = [perl curl bzip2 aterm242fixes db4] 
-          ++ map (x : sourceWithTagsDerivation ( (addCTaggingInfo x ).passthru.sourceWithTags ) ) [ glibc ];
-   db4 = db44;
-   aterm = aterm242fixes;
-   name = "env_nix";
-   userCmds = ". ~/.bashrc
-    PS1='\033]2;\h:\u:\w\007\\nenv ${name} \[\033[1;32m\][\u@\h: \w ]$\[\033[0m\] '
-     ";
+  # example: 
+  # add postgresql to environment and create ctags (tagfiles can be extracted from TAG_FILES)
+  # add this to your ~/.nixpkgs/config.nix
+
+ devEnvs = pkgs : with pkgs; with sourceAndTags;
+  let simple = { name, buildInputs ? [], cTags ? [] }:
+          pkgs.myEnvFun {
+            inherit name stdenv;
+          buildInputs = buildInputs 
+                ++ 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
-loadEnv(){
-  . "${HOME}/.nix-profile/dev-envs/${1}"
-}
+
+  Put this into your .bashrc
+    loadEnv(){ . "${HOME}/.nix-profile/dev-envs/${1}" }
+  then install and 
+    $ loadEnv postgresql
+
 */
 
 args: args.stdenv.mkDerivation ( 
   { extraCmds =""; } // {
   phases = "buildPhase";
-  buildPhase = ''
+  buildPhase = '' 
+    eval "$preBuild"
     name=${args.name}
     o=$out/dev-envs/$name
     ensureDir `dirname $o`
@@ -39,6 +54,5 @@ args: args.stdenv.mkDerivation (
     $extraCmds
     echo env $name loaded
     " >> $o
-    chmod +x $o
   '';
 } // args // { name = "${args.name}-env"; } )
diff --git a/pkgs/misc/source-and-tags/default.nix b/pkgs/misc/source-and-tags/default.nix
index 3d15be20597..d9b4717cb70 100644
--- a/pkgs/misc/source-and-tags/default.nix
+++ b/pkgs/misc/source-and-tags/default.nix
@@ -32,7 +32,8 @@ args: with args; {
           eval \"\$cmd\";
           TAG_FILES=\"\$TAG_FILES\${TAG_FILES:+:}\$TAG_FILE\"
        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