Compare commits
2 Commits
woodpekcer
...
d881a7e878
Author | SHA1 | Date | |
---|---|---|---|
|
d881a7e878 | ||
|
471273633c |
@@ -3,17 +3,6 @@ steps:
|
||||
image: nixos/nix
|
||||
commands:
|
||||
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
||||
|
||||
- "nix develop --command dotnet publish AdventOfCode2023.FSharp/AdventOfCode2023.FSharp/AdventOfCode2023.FSharp.fsproj --configuration Release -p:PublishAot=true || echo 'First publish failed'"
|
||||
- "nix develop --command sh -c 'patchelf --set-interpreter $LINKER_PATH /tmp/dotnet-home/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.0/tools/ilc'"
|
||||
- "ls -al /tmp/dotnet-home/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.0/tools/ilc"
|
||||
- "chmod a+x /tmp/dotnet-home/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.0/tools/ilc"
|
||||
- "ls -al /tmp/dotnet-home/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.0/tools/ilc"
|
||||
- "whoami"
|
||||
- "cp -r AdventOfCode2023.FSharp/AdventOfCode2023.FSharp/obj /tmp/obj"
|
||||
- "nix develop --command sh -c 'ls -la $LINKER_PATH'"
|
||||
- "nix develop --command sh -c 'strace /tmp/dotnet-home/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.0/tools/ilc /tmp/obj/Release/net8.0/linux-x64/native/AdventOfCode2023.FSharp.ilc.rsp'"
|
||||
- "nix develop --command dotnet publish AdventOfCode2023.FSharp/AdventOfCode2023.FSharp/AdventOfCode2023.FSharp.fsproj --configuration Release -p:PublishAot=true"
|
||||
# Lint
|
||||
- "nix flake check"
|
||||
# Test
|
||||
|
@@ -1,23 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Arr2D.fs" />
|
||||
<Compile Include="ResizeArray.fs" />
|
||||
<Compile Include="EfficientString.fs" />
|
||||
<Compile Include="Arithmetic.fs" />
|
||||
<Compile Include="Day1.fs" />
|
||||
<Compile Include="Day2.fs" />
|
||||
<Compile Include="Day3.fs" />
|
||||
<Compile Include="Day4.fs" />
|
||||
<Compile Include="Day5.fs" />
|
||||
<Compile Include="Day6.fs" />
|
||||
<Compile Include="Day7.fs" />
|
||||
<Compile Include="Day8.fs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Arr2D.fs"/>
|
||||
<Compile Include="ResizeArray.fs"/>
|
||||
<Compile Include="EfficientString.fs"/>
|
||||
<Compile Include="Arithmetic.fs"/>
|
||||
<Compile Include="Rational.fs"/>
|
||||
<Compile Include="Day1.fs"/>
|
||||
<Compile Include="Day2.fs"/>
|
||||
<Compile Include="Day3.fs"/>
|
||||
<Compile Include="Day4.fs"/>
|
||||
<Compile Include="Day5.fs"/>
|
||||
<Compile Include="Day6.fs"/>
|
||||
<Compile Include="Day7.fs"/>
|
||||
<Compile Include="Day8.fs"/>
|
||||
<Compile Include="Day9.fs"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
55
AdventOfCode2023.FSharp/AdventOfCode2023.FSharp.Lib/Day9.fs
Normal file
55
AdventOfCode2023.FSharp/AdventOfCode2023.FSharp.Lib/Day9.fs
Normal file
@@ -0,0 +1,55 @@
|
||||
namespace AdventOfCode2023
|
||||
|
||||
open System
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Day9 =
|
||||
|
||||
let extrapolate (isStart : bool) (arr : ResizeArray<int64>) =
|
||||
let mutable answer = 0L
|
||||
let pos = if isStart then -1L else int64 arr.Count
|
||||
|
||||
for i = 0 to arr.Count - 1 do
|
||||
let mutable product = Rational.ofInt arr.[i]
|
||||
|
||||
for j = 0 to arr.Count - 1 do
|
||||
if j <> i then
|
||||
product <- product * Rational.make (pos - int64 j) (int64 i - int64 j)
|
||||
|
||||
answer <- answer + Rational.assertIntegral product
|
||||
|
||||
answer
|
||||
|
||||
let part1 (s : string) =
|
||||
use s = StringSplitEnumerator.make '\n' s
|
||||
let mutable answer = 0L
|
||||
let arr = ResizeArray ()
|
||||
|
||||
for line in s do
|
||||
arr.Clear ()
|
||||
use line = StringSplitEnumerator.make' ' ' line
|
||||
|
||||
for number in line do
|
||||
let number = Int64.Parse number
|
||||
arr.Add number
|
||||
|
||||
answer <- answer + extrapolate false arr
|
||||
|
||||
answer
|
||||
|
||||
let part2 (s : string) =
|
||||
use s = StringSplitEnumerator.make '\n' s
|
||||
let mutable answer = 0L
|
||||
let arr = ResizeArray ()
|
||||
|
||||
for line in s do
|
||||
arr.Clear ()
|
||||
use line = StringSplitEnumerator.make' ' ' line
|
||||
|
||||
for number in line do
|
||||
let number = Int64.Parse number
|
||||
arr.Add number
|
||||
|
||||
answer <- answer + extrapolate true arr
|
||||
|
||||
answer
|
@@ -1,7 +1,6 @@
|
||||
namespace AdventOfCode2023
|
||||
|
||||
open System
|
||||
open System.Globalization
|
||||
open System.Runtime.CompilerServices
|
||||
|
||||
type EfficientString = System.ReadOnlySpan<char>
|
||||
|
@@ -0,0 +1,82 @@
|
||||
namespace AdventOfCode2023
|
||||
|
||||
[<Struct>]
|
||||
type Rational<'a
|
||||
when 'a : (static member (+) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (*) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (/) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (-) : 'a * 'a -> 'a)
|
||||
and 'a : (static member Zero : 'a)
|
||||
and 'a : (static member One : 'a)
|
||||
and 'a : comparison> =
|
||||
{
|
||||
Numerator : 'a
|
||||
Denominator : 'a
|
||||
}
|
||||
|
||||
static member inline (+) (a : Rational<'a>, b : Rational<'a>) =
|
||||
let numerator = a.Numerator * b.Denominator + b.Numerator * a.Denominator
|
||||
let denominator = a.Denominator * b.Denominator
|
||||
let hcf = (Arithmetic.euclideanAlgorithm numerator denominator).Hcf
|
||||
|
||||
{
|
||||
Numerator = numerator / hcf
|
||||
Denominator = denominator / hcf
|
||||
}
|
||||
|
||||
static member inline (*) (a : Rational<'a>, b : Rational<'a>) =
|
||||
let numerator = a.Numerator * b.Numerator
|
||||
let denominator = a.Denominator * b.Denominator
|
||||
let hcf = (Arithmetic.euclideanAlgorithm numerator denominator).Hcf
|
||||
|
||||
{
|
||||
Numerator = numerator / hcf
|
||||
Denominator = denominator / hcf
|
||||
}
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Rational =
|
||||
let inline ofInt< ^a
|
||||
when 'a : (static member (+) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (*) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (/) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (-) : 'a * 'a -> 'a)
|
||||
and 'a : (static member Zero : 'a)
|
||||
and 'a : (static member One : 'a)
|
||||
and 'a : comparison>
|
||||
(a : 'a)
|
||||
=
|
||||
{
|
||||
Numerator = a
|
||||
Denominator = LanguagePrimitives.GenericOne
|
||||
}
|
||||
|
||||
let inline make< ^a
|
||||
when 'a : (static member (+) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (*) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (/) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (-) : 'a * 'a -> 'a)
|
||||
and 'a : (static member Zero : 'a)
|
||||
and 'a : (static member One : 'a)
|
||||
and 'a : comparison>
|
||||
(numerator : 'a)
|
||||
(denominator : 'a)
|
||||
=
|
||||
let hcf = (Arithmetic.euclideanAlgorithm numerator denominator).Hcf
|
||||
|
||||
{
|
||||
Numerator = numerator / hcf
|
||||
Denominator = denominator / hcf
|
||||
}
|
||||
|
||||
let inline assertIntegral< ^a
|
||||
when 'a : (static member (+) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (*) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (/) : 'a * 'a -> 'a)
|
||||
and 'a : (static member (-) : 'a * 'a -> 'a)
|
||||
and 'a : (static member Zero : 'a)
|
||||
and 'a : (static member One : 'a)
|
||||
and 'a : comparison>
|
||||
(r : Rational<'a>)
|
||||
=
|
||||
r.Numerator
|
@@ -1,28 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<PublishAot>true</PublishAot>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<UseSystemResourceKeys>true</UseSystemResourceKeys>
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<PublishAot>true</PublishAot>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<UseSystemResourceKeys>true</UseSystemResourceKeys>
|
||||
|
||||
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
|
||||
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
|
||||
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
|
||||
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
|
||||
|
||||
<DebuggerSupport>false</DebuggerSupport>
|
||||
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
|
||||
<EventSourceSupport>false</EventSourceSupport>
|
||||
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
|
||||
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
|
||||
</PropertyGroup>
|
||||
<DebuggerSupport>false</DebuggerSupport>
|
||||
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
|
||||
<EventSourceSupport>false</EventSourceSupport>
|
||||
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
|
||||
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.fs"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.fs"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2023.FSharp.Lib\AdventOfCode2023.FSharp.Lib.fsproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2023.FSharp.Lib\AdventOfCode2023.FSharp.Lib.fsproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@@ -179,6 +179,22 @@ module Program =
|
||||
Console.WriteLine (part2.ToString ())
|
||||
Console.Error.WriteLine ((1_000.0 * float sw.ElapsedTicks / float Stopwatch.Frequency).ToString () + "ms")
|
||||
|
||||
Console.WriteLine "=====Day 9====="
|
||||
|
||||
do
|
||||
let input = Path.Combine (dir.FullName, "day9.txt") |> File.ReadAllText
|
||||
|
||||
sw.Restart ()
|
||||
let part1 = Day9.part1 input
|
||||
sw.Stop ()
|
||||
Console.WriteLine (part1.ToString ())
|
||||
Console.Error.WriteLine ((1_000.0 * float sw.ElapsedTicks / float Stopwatch.Frequency).ToString () + "ms")
|
||||
sw.Restart ()
|
||||
let part2 = Day9.part2 input
|
||||
sw.Stop ()
|
||||
Console.WriteLine (part2.ToString ())
|
||||
Console.Error.WriteLine ((1_000.0 * float sw.ElapsedTicks / float Stopwatch.Frequency).ToString () + "ms")
|
||||
|
||||
endToEnd.Stop ()
|
||||
|
||||
Console.Error.WriteLine (
|
||||
|
@@ -1,44 +1,46 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Util.fs" />
|
||||
<Compile Include="TestDay1.fs" />
|
||||
<Compile Include="TestDay2.fs" />
|
||||
<Compile Include="TestDay3.fs" />
|
||||
<Compile Include="TestDay4.fs" />
|
||||
<Compile Include="TestDay5.fs" />
|
||||
<Compile Include="TestDay6.fs" />
|
||||
<Compile Include="TestDay7.fs" />
|
||||
<Compile Include="TestDay8.fs" />
|
||||
<EmbeddedResource Include="samples\day1.txt" />
|
||||
<EmbeddedResource Include="samples\day1part1.txt" />
|
||||
<EmbeddedResource Include="samples\day2.txt" />
|
||||
<EmbeddedResource Include="samples\day3.txt" />
|
||||
<EmbeddedResource Include="samples\day4.txt" />
|
||||
<EmbeddedResource Include="samples\day5.txt" />
|
||||
<EmbeddedResource Include="samples\day6.txt" />
|
||||
<EmbeddedResource Include="samples\day7.txt" />
|
||||
<EmbeddedResource Include="samples\day8part1.txt" />
|
||||
<EmbeddedResource Include="samples\day8.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Util.fs"/>
|
||||
<Compile Include="TestDay1.fs"/>
|
||||
<Compile Include="TestDay2.fs"/>
|
||||
<Compile Include="TestDay3.fs"/>
|
||||
<Compile Include="TestDay4.fs"/>
|
||||
<Compile Include="TestDay5.fs"/>
|
||||
<Compile Include="TestDay6.fs"/>
|
||||
<Compile Include="TestDay7.fs"/>
|
||||
<Compile Include="TestDay8.fs"/>
|
||||
<Compile Include="TestDay9.fs"/>
|
||||
<EmbeddedResource Include="samples\day1.txt"/>
|
||||
<EmbeddedResource Include="samples\day1part1.txt"/>
|
||||
<EmbeddedResource Include="samples\day2.txt"/>
|
||||
<EmbeddedResource Include="samples\day3.txt"/>
|
||||
<EmbeddedResource Include="samples\day4.txt"/>
|
||||
<EmbeddedResource Include="samples\day5.txt"/>
|
||||
<EmbeddedResource Include="samples\day6.txt"/>
|
||||
<EmbeddedResource Include="samples\day7.txt"/>
|
||||
<EmbeddedResource Include="samples\day8part1.txt"/>
|
||||
<EmbeddedResource Include="samples\day8.txt"/>
|
||||
<EmbeddedResource Include="samples\day9.txt"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FsUnit" Version="5.6.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"/>
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FsUnit" Version="5.6.1"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"/>
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2023.FSharp.Lib\AdventOfCode2023.FSharp.Lib.fsproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2023.FSharp.Lib\AdventOfCode2023.FSharp.Lib.fsproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@@ -1,6 +1,5 @@
|
||||
namespace AdventOfCode2023.Test
|
||||
|
||||
open System
|
||||
open AdventOfCode2023
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
|
@@ -1,6 +1,5 @@
|
||||
namespace AdventOfCode2023.Test
|
||||
|
||||
open System
|
||||
open AdventOfCode2023
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
|
@@ -1,6 +1,5 @@
|
||||
namespace AdventOfCode2023.Test
|
||||
|
||||
open System
|
||||
open AdventOfCode2023
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
|
47
AdventOfCode2023.FSharp/Test/TestDay9.fs
Normal file
47
AdventOfCode2023.FSharp/Test/TestDay9.fs
Normal file
@@ -0,0 +1,47 @@
|
||||
namespace AdventOfCode2023.Test
|
||||
|
||||
open AdventOfCode2023
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
open System.IO
|
||||
|
||||
[<TestFixture>]
|
||||
module TestDay9 =
|
||||
|
||||
let sample = Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day9.txt"
|
||||
|
||||
[<Test>]
|
||||
let part1Sample () =
|
||||
sample |> Day9.part1 |> shouldEqual 114L
|
||||
|
||||
[<Test>]
|
||||
let part2Sample () =
|
||||
Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day9.txt"
|
||||
|> Day9.part2
|
||||
|> shouldEqual 2L
|
||||
|
||||
[<Test>]
|
||||
let part1Actual () =
|
||||
let s =
|
||||
try
|
||||
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day9.txt"))
|
||||
with
|
||||
| :? DirectoryNotFoundException
|
||||
| :? FileNotFoundException ->
|
||||
Assert.Inconclusive ()
|
||||
failwith "unreachable"
|
||||
|
||||
Day9.part1 s |> shouldEqual 1898776583L
|
||||
|
||||
[<Test>]
|
||||
let part2Actual () =
|
||||
let s =
|
||||
try
|
||||
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day9.txt"))
|
||||
with
|
||||
| :? DirectoryNotFoundException
|
||||
| :? FileNotFoundException ->
|
||||
Assert.Inconclusive ()
|
||||
failwith "unreachable"
|
||||
|
||||
Day9.part2 s |> shouldEqual 1100L
|
3
AdventOfCode2023.FSharp/Test/samples/day9.txt
Normal file
3
AdventOfCode2023.FSharp/Test/samples/day9.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
0 3 6 9 12 15
|
||||
1 3 6 10 15 21
|
||||
10 13 16 21 30 45
|
21
flake.lock
generated
21
flake.lock
generated
@@ -18,26 +18,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-ld": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701153607,
|
||||
"narHash": "sha256-h+odOVyiGmEERMECoFOj5P7FPiMR8IPRzroFA4sKivg=",
|
||||
"owner": "Mic92",
|
||||
"repo": "nix-ld",
|
||||
"rev": "bf5aa84a713c31d95b4307e442e966d6c7fd7ae7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Mic92",
|
||||
"repo": "nix-ld",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1701253981,
|
||||
@@ -57,7 +37,6 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nix-ld": "nix-ld",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
|
13
flake.nix
13
flake.nix
@@ -3,17 +3,12 @@
|
||||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nix-ld = {
|
||||
url = "github:Mic92/nix-ld";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
nix-ld,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
@@ -30,14 +25,9 @@
|
||||
pkgs.darwin.apple_sdk.frameworks.GSS
|
||||
]
|
||||
else [];
|
||||
in let
|
||||
deps = darwinDeps ++ [pkgs.zlib pkgs.zlib.dev pkgs.openssl pkgs.icu];
|
||||
in {
|
||||
devShells = {
|
||||
default = pkgs.mkShell {
|
||||
HOME = "/tmp/dotnet-home";
|
||||
NUGET_PACKAGES = "/tmp/dotnet-home/.nuget/packages";
|
||||
LINKER_PATH = "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
(with dotnetCorePackages;
|
||||
@@ -46,7 +36,8 @@
|
||||
dotnetPackages.Nuget
|
||||
])
|
||||
]
|
||||
++ [pkgs.alejandra pkgs.patchelf pkgs.strace];
|
||||
++ darwinDeps
|
||||
++ [pkgs.zlib pkgs.zlib.dev pkgs.openssl pkgs.icu pkgs.alejandra];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user