nixpkgs-suyu/pkgs/misc/ghc68executables/nix-repository-manager.nix
Marc Weber 9d181d621f updated nixRepositoryManager
now you can use specify another source file for testing in a nix way

svn path=/nixpkgs/trunk/; revision=12662
2008-08-19 13:31:52 +00:00

47 lines
1.6 KiB
Nix

/*
repos for config file taken from all-pacakges.bleedingEdgeFetchInfo
nix-repository-manager --update <name> (for your local use only)
if you want to publish repos ask for the password (marco-oweber@gmx.de)
echo '{ bleedingEdgeFetchInfo = "${your_nix_pkgs_location}/pkgs/misc/bleeding-edge-fetch-info"; }' >> .nixpkgs/config.nix
reinstall nix-repository-manager to recreate config
nix-repository-manager --publish <name> (to save on server
*/
args: with args; with args.lib;
let
toConfigLine = name : set :
"[(\"name\",\"${name}\")," + ( concatStringsSep "," (map (a: "(\"${a}\",\"${__getAttr a set}\")" ) (__attrNames set)))+"]";
config = pkgs.writeText "nix-repository-manager_config"
(bleedingEdgeRepos.managedRepoDir+"\n" +
concatStringsSep "\n" (mapRecordFlatten toConfigLine (bleedingEdgeRepos.repos)));
in
{
name = "nix-repository-manager";
libsFun = x : [x.base x.time x.old_locale x.mtl];
src = bleedingEdgeRepos.sourceByName "nix_repository_manager";
pass = {
buildPhase = ''
cp ${pkgs.getConfig ["nixRepositoryManager" "sourcefile"] "nix-repository-manager.hs"} source.hs
s=$out/share/nix-repository-manager
ensureDir $out/bin $s
ghc --make source.hs -o $s/nix-repository-manager
b=$out/bin/nix-repository-manager
echo -e "#!/bin/sh\n$s/nix-repository-manager ${config} \$@" > $b
chmod +x $b
'';
};
meta = {
description = "makes it easy to keep some packages up to date";
homepage = http://mawercer.de/repos/nix-repository-manager;
license = "GPL";
};
}