-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
134 lines (118 loc) · 3.6 KB
/
flake.nix
File metadata and controls
134 lines (118 loc) · 3.6 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
description = ".NET & Powershell Development Environment";
nixConfig = {
extra-substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://devenv.cachix.org"
"https://pre-commit-hooks.cachix.org"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv.url = "github:cachix/devenv";
treefmt.url = "github:numtide/treefmt-nix";
};
outputs =
inputs@{
flake-parts,
devenv,
treefmt,
nixpkgs,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } (
{
...
}:
{
imports = [
devenv.flakeModule
treefmt.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{
pkgs,
lib,
...
}:
{
packages.compiler = pkgs.buildDotnetModule {
pname = "Compiler";
version = "0.0.1";
src = ./.;
projectFile = "./scripts.sln";
nugetDeps = ./src/Compiler/deps.json;
buildInputs = [ ];
runtimeDeps = [ ];
dotnet-sdk = pkgs.dotnetCorePackages.sdk_10_0;
dotnet-runtime = pkgs.dotnetCorePackages.runtime_10_0;
executables = [ "Compiler" ];
};
treefmt = {
programs = {
actionlint.enable = true;
deadnix.enable = true;
nixfmt.enable = true;
statix.enable = true;
mdformat.enable = true;
};
settings.global.excludes = [
"docs/**"
];
};
devenv.shells.default = {
# Fixes https://github.com/cachix/devenv/issues/528
containers = lib.mkForce { };
packages = with pkgs; [
powershell
powershell-editor-services
nuget-to-json
roslyn-ls
];
languages = {
nix.enable = true;
dotnet = {
enable = true;
package = pkgs.dotnet-sdk_10.overrideAttrs (oldAttrs: {
postBuild =
(oldAttrs.postBuild or '''')
+ ''
for i in $out/sdk/*; do
i=$(basename $i)
mkdir -p $out/metadata/workloads/''${i/-*}
touch $out/metadata/workloads/''${i/-*}/userlocal
done
'';
});
};
};
git-hooks = {
hooks = {
nil.enable = true;
actionlint.enable = true;
deadnix.enable = true;
statix.enable = true;
nixfmt-rfc-style.enable = true;
flake-checker.enable = true;
editorconfig-checker.enable = true;
};
};
};
};
}
);
}