forked from ClassIsland/ClassIsland
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
82 lines (79 loc) · 2.11 KB
/
flake.nix
File metadata and controls
82 lines (79 loc) · 2.11 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
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs =
{
self,
nixpkgs,
flake-utils,
}:
# TODO: darwin support
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (
system:
let
pkgs = import nixpkgs { inherit system; };
projectFile = "./ClassIsland.Desktop/ClassIsland.Desktop.csproj";
dotnet-sdk =
with pkgs.dotnetCorePackages;
pkgs.dotnetCorePackages.combinePackages [
sdk_9_0
sdk_8_0
sdk_6_0
];
dotnet-runtime = pkgs.dotnetCorePackages.runtime_8_0;
version = "2.0.0.0";
classisland = pkgs.buildDotnetModule {
inherit
projectFile
dotnet-sdk
dotnet-runtime
version
;
pname = "classisland";
src = ./.;
# nix build .#default.passthru.fetch-deps && ./result deps.json
# 生成完后可能需要手动修改
nugetDeps = ./deps.json;
doCheck = true;
dotnetBuildFlags = [
"--property:NIX=true"
];
runtimeDeps = with pkgs; [
xorg.libX11
xorg.libICE
xorg.libSM
xorg.libXfixes
fontconfig
];
executables = [ "ClassIsland.Desktop" ];
nativeBuildInputs = with pkgs; [
git
stdenv.cc.cc.lib
autoPatchelfHook
];
postInstall = ''
echo deb > $out/lib/classisland/PackageType
'';
packNupkg = false;
};
in
{
packages.default = classisland;
apps.default = {
type = "app";
program = "${classisland}/bin/ClassIsland.Desktop";
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
nuget-to-json
dotnet-sdk
xorg.libX11
xorg.libICE
xorg.libSM
xorg.libXfixes
fontconfig
];
};
}
);
}