[Nix-dev] Mirrors for fetchurl & Multiple versions

Wouter uu at denbreejen.net
Sun Jan 20 15:20:19 CET 2008


Hi,

I sometimes have problems with unavailable sources.

I think we should have the possibility to express mirrors:

fetchurl {
                urls = [ 
ftp://freepascal.stack.nl/pub/fpc/dist/i386-linux-2.0.4/fpc-2.0.4.i386-linux.tar 

                            
ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/i386-linux-2.0.4/fpc-2.0.4.i386-linux.tar 
];
                sha256 = 
"0b2szv2anbf58h4i5mlph93afv9qdx6i0jqggba04d3anjbl9gfy";
};

I thought that nix.cs.uu.nl mirrored all sources automatically, but i 
seems not to do so always.

Second, sometimes I want to try an old version, but this is not easily 
possible because we destructively overwrite Nix expressions. I can go 
check SVN of course, but maybe we can expresses multiple versions in the 
same expression. I know that some versions might require different 
things, but maybe we can do something like this:

----------------
currentVersion = getVersion "2.0.6" versions

versions = [
{              version = "2.0.4";
                urls = [ 
ftp://freepascal.stack.nl/pub/fpc/dist/i386-linux-2.0.4/fpc-2.0.4.i386-linux.tar 

                            
ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/i386-linux-2.0.4/fpc-2.0.4.i386-linux.tar 
];
                sha256 = 
"0b2szv2anbf58h4i5mlph93afv9qdx6i0jqggba04d3anjbl9gfy";
}
{              version = "2.0.5";
                urls = [ 
ftp://freepascal.stack.nl/pub/fpc/dist/i386-linux-2.0.4/fpc-2.0.5.i386-linux.tar 

                            
ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/i386-linux-2.0.4/fpc-2.0.5.i386-linux.tar 
];
                sha256 = "xxxxxxxxxx";
}
{              version = "2.0.6";
                urls = [ 
ftp://freepascal.stack.nl/pub/fpc/dist/i386-linux-2.0.4/fpc-2.0.6.i386-linux.tar 

                            
ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/i386-linux-2.0.4/fpc-2.0.6.i386-linux.tar 
];
                sha256 = "xxxxxxxxxxx";
} ];
----------------

and really destructively update or create new expressions when a new 
version does need different things dependencies or patches.

So we would have 1 expression for sets of versions that work.

But on the other hand, it is verbose and maybe not going to be used 
much, but maybe you have some thoughts on it.

Wouter




More information about the nix-dev mailing list