diff options
Diffstat (limited to 'pkgs/development/compilers/dotnet/combine-deps.nix')
-rw-r--r-- | pkgs/development/compilers/dotnet/combine-deps.nix | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/pkgs/development/compilers/dotnet/combine-deps.nix b/pkgs/development/compilers/dotnet/combine-deps.nix index af21c3aa248e..188c26cf27fa 100644 --- a/pkgs/development/compilers/dotnet/combine-deps.nix +++ b/pkgs/development/compilers/dotnet/combine-deps.nix @@ -2,7 +2,7 @@ list, baseRid, otherRids, - pkgs ? import ../../../.. {} + pkgs ? import ../../../.. { }, }: let inherit (pkgs) writeText; @@ -20,31 +20,36 @@ let fns = map (file: import file) list; - packages = unique - (concatMap (fn: fn { fetchNuGet = package: package; }) fns); + packages = unique (concatMap (fn: fn { fetchNuGet = package: package; }) fns); - changePackageRid = package: rid: - let replace = replaceStrings [".${baseRid}"] [".${rid}"]; - in rec { + changePackageRid = + package: rid: + let + replace = replaceStrings [ ".${baseRid}" ] [ ".${rid}" ]; + in + rec { pname = replace package.pname; inherit (package) version; url = replace package.url; sha256 = builtins.hashFile "sha256" (builtins.fetchurl url); }; - expandPackage = package: - [ package ] ++ - optionals (strings.match ".*\\.${baseRid}(\\..*|$)" package.pname != null) - (map (changePackageRid package) otherRids); + expandPackage = + package: + [ package ] + ++ optionals (strings.match ".*\\.${baseRid}(\\..*|$)" package.pname != null) ( + map (changePackageRid package) otherRids + ); - allPackages = - sortOn (package: [ package.pname package.version ]) - (concatMap expandPackage packages); + allPackages = sortOn (package: [ + package.pname + package.version + ]) (concatMap expandPackage packages); - fetchExpr = package: - " (fetchNuGet ${generators.toPretty { multiline = false; } package})"; + fetchExpr = package: " (fetchNuGet ${generators.toPretty { multiline = false; } package})"; -in writeText "deps.nix" '' +in +writeText "deps.nix" '' { fetchNuGet }: [ ${concatMapStringsSep "\n" fetchExpr allPackages} ] |