-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (51 loc) · 1.32 KB
/
flake.nix
File metadata and controls
62 lines (51 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
description = ".NET env";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { nixpkgs, ... }:
let
supportedArch = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllArch = nixpkgs.lib.genAttrs supportedArch;
in
{
devShells = forAllArch (arch:
let
pkgs = nixpkgs.legacyPackages.${arch};
globalJson = builtins.fromJSON (builtins.readFile ./global.json);
version = builtins.splitVersion globalJson.sdk.version;
major = builtins.elemAt version 0;
minor = builtins.elemAt version 1;
dotnet = pkgs.dotnetCorePackages."sdk_${major}_${minor}-bin";
docfx = pkgs.buildDotnetGlobalTool {
pname = "docfx";
version = "2.78.3";
nugetHash = "sha256-hLb6OmxqXOOxFaq/N+aZ0sAzEYjU0giX3c1SWQtKDbs=";
dotnet-sdk = dotnet;
};
dotnetRoot = "${dotnet.unwrapped}/share/dotnet";
in
{
default = pkgs.mkShell {
packages = [
dotnet
];
DOTNET_ROOT = dotnetRoot;
};
docs = pkgs.mkShell {
packages = [
docfx
dotnet
pkgs.nodejs_25
];
DOTNET_ROOT = dotnetRoot;
};
}
);
};
}