This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
/
default.nix
56 lines (49 loc) · 1.5 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
nixpkgs ? builtins.fetchGit { url = https://github.com/NixOS/nixpkgs-channels.git; ref = "nixos-18.03"; }
}:
let
pkgs = import nixpkgs {};
fetchNuGetSha512 = pkgs.callPackage
({ fetchurl, buildDotnetPackage, unzip }:
attrs @
{ baseName
, version
, url ? "https://www.nuget.org/api/v2/package/${baseName}/${version}"
, sha512 ? ""
, md5 ? ""
, ...
}:
if md5 != "" then
throw "fetchnuget does not support md5 anymore, please use sha256"
else
buildDotnetPackage ({
src = fetchurl {
inherit url sha512;
name = "${baseName}.${version}.zip";
};
sourceRoot = ".";
buildInputs = [ unzip ];
dontBuild = true;
preInstall = ''
function traverseRename () {
for e in *
do
t="$(echo "$e" | sed -e "s/%20/\ /g" -e "s/%2B/+/g")"
[ "$t" != "$e" ] && mv -vn "$e" "$t"
if [ -d "$t" ]
then
cd "$t"
traverseRename
cd ..
fi
done
}
traverseRename
'';
} // attrs)) {};
nugets = import ./dotnet2nix/nuget.nix ;
jobs = rec {
allNuGets = pkgs.recurseIntoAttrs (pkgs.callPackage ./dotnet2nix/nuget.nix {fetchNuGet = fetchNuGetSha512;});
};
in
jobs