buildDotnetModule: allow lockFile path to be set in nugetDeps

This allows fetch-deps to find the lock-file for roslyn.

+19 -6
+9 -3
pkgs/build-support/dotnet/build-dotnet-module/default.nix
··· 112 112 if (nugetDeps != null) then 113 113 if lib.isDerivation nugetDeps 114 114 then nugetDeps 115 - else mkNugetDeps { inherit name; nugetDeps = import nugetDeps; } 115 + else mkNugetDeps { 116 + inherit name; 117 + nugetDeps = import nugetDeps; 118 + sourceFile = nugetDeps; 119 + } 116 120 else throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script."; 117 121 118 122 # contains the actual package dependencies ··· 138 142 name = "${name}-nuget-source"; 139 143 paths = [ dependenciesSource sdkSource ]; 140 144 }; 145 + 146 + nugetDepsFile = _nugetDeps.sourceFile; 141 147 in 142 148 stdenvNoCC.mkDerivation (args // { 143 149 nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ ··· 180 186 # Note that toString is necessary here as it results in the path at 181 187 # eval time (i.e. to the file in your local Nixpkgs checkout) rather 182 188 # than the Nix store path of the path after it's been imported. 183 - if lib.isPath nugetDeps && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDeps) 184 - then toString nugetDeps 189 + if lib.isPath nugetDepsFile && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDepsFile) 190 + then toString nugetDepsFile 185 191 else ''$(mktemp -t "${pname}-deps-XXXXXX.nix")''; 186 192 in 187 193 writeShellScript "fetch-${pname}-deps" ''
+4 -2
pkgs/build-support/dotnet/make-nuget-deps/default.nix
··· 1 1 { linkFarmFromDrvs, fetchurl }: 2 - { name, nugetDeps }: 2 + { name, nugetDeps, sourceFile ? null }: 3 3 linkFarmFromDrvs "${name}-nuget-deps" (nugetDeps { 4 4 fetchNuGet = { pname, version, sha256 5 5 , url ? "https://www.nuget.org/api/v2/package/${pname}/${version}" }: ··· 7 7 name = "${pname}.${version}.nupkg"; 8 8 inherit url sha256; 9 9 }; 10 - }) 10 + }) // { 11 + inherit sourceFile; 12 + }
+6 -1
pkgs/development/compilers/roslyn/default.nix
··· 4 4 , buildDotnetModule 5 5 , dotnetCorePackages 6 6 , unzip 7 + , mkNugetDeps 7 8 }: 8 9 9 10 buildDotnetModule rec { ··· 21 22 22 23 projectFile = [ "src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj" ]; 23 24 24 - nugetDeps = ./extended-deps.nix; 25 + nugetDeps = mkNugetDeps { 26 + name = "${pname}-deps"; 27 + nugetDeps = import ./extended-deps.nix; 28 + sourceFile = ./deps.nix; 29 + }; 25 30 26 31 dontDotnetFixup = true; 27 32