So I’m trying to make a package build for a game. I’ve successfully built the package manually using a nix-shell
environment and following the build instructions, but when I turned it into a package build for nixpkgs
and ran nix-build -A osu-lazer
I got this error.
System.UnauthorizedAccessException: Access to the path '/homeless-shelter/.dotnet' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at System.IO.FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at Microsoft.Extensions.EnvironmentAbstractions.DirectoryWrapper.CreateDirectory(String path)
at Microsoft.DotNet.Configurer.FileSystemExtensions.<>c__DisplayClass0_0.<CreateIfNotExists>b__0()
at Microsoft.DotNet.Cli.Utils.FileAccessRetrier.RetryOnIOException(Action action)
at Microsoft.DotNet.Configurer.FileSystemExtensions.CreateIfNotExists(IFileSystem fileSystem, String filePath)
at Microsoft.DotNet.Configurer.FileSentinel.Create()
at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, IAspNetCertificateSentinel aspNetCertificateSentinel, IFileSentinel toolPathSentinel, Boolean hasSuperUserAccess, DotnetFirstRunConfiguration dotnetFirstRunConfiguration, IEnvironmentProvider environmentProvider)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
builder for '/nix/store/j764cq6sxbrkvjb46nma7lizr6bv2161-osu-lazer-2020.306.0.drv' failed with exit code 1
error: build of '/nix/store/j764cq6sxbrkvjb46nma7lizr6bv2161-osu-lazer-2020.306.0.drv' failed
I’ve tried changing the $HOME
envar to something else (like “.” or “/tmp”) which “fixes” this issue, but then I get a different error related to the loading of NuGet targets
/nix/store/p51d8cay00f9iyj5aybgfl1ha6pv07mv-dotnet-sdk-3.1.102/sdk/3.1.102/NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/build/source/osu.Desktop/osu.Desktop.csproj]
/nix/store/p51d8cay00f9iyj5aybgfl1ha6pv07mv-dotnet-sdk-3.1.102/sdk/3.1.102/NuGet.targets(123,5): error : Name or service not known [/build/source/osu.Desktop/osu.Desktop.csproj]
Build FAILED.
/nix/store/p51d8cay00f9iyj5aybgfl1ha6pv07mv-dotnet-sdk-3.1.102/sdk/3.1.102/NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/build/source/osu.Desktop/osu.Desktop.csproj]
/nix/store/p51d8cay00f9iyj5aybgfl1ha6pv07mv-dotnet-sdk-3.1.102/sdk/3.1.102/NuGet.targets(123,5): error : Name or service not known [/build/source/osu.Desktop/osu.Desktop.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.32
builder for '/nix/store/20ili9qq4q9c21c0vv9ip6x5nrq7cwrw-osu-lazer-2020.306.0.drv' failed with exit code 1
error: build of '/nix/store/20ili9qq4q9c21c0vv9ip6x5nrq7cwrw-osu-lazer-2020.306.0.drv' failed