Files

39 lines
1.2 KiB
Nix

{
description = "Advent of Code solutions in C#";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};
# to generate the deps.json, first
# run `dotnet restore --packages out` which
# will put all the dependencies in the "out" directory.
# Second, run `nuget-to-json out > deps.json` to generate the
# deps.json
project = pkgs.buildDotnetModule {
pname = "adventOfCode";
version = "0.1.0";
src = ./.;
nugetDeps = ./deps.json;
projectFile = "adventOfCode/adventOfCode.csproj";
dotnetBuildFlags = [ "--no-self-contained" ];
dotnet-sdk = pkgs.dotnetCorePackages.sdk_10_0;
dotnet-runtime = pkgs.dotnetCorePackages.aspnetcore_10_0;
};
in {
packages = { project = project; };
devShells.default = pkgs.mkShell {
buildInputs = [ pkgs.dotnet-sdk_10 pkgs.nuget-to-json ];
};
});
}