forked from WalletWasabi/WalletWasabi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
72 lines (68 loc) · 2.75 KB
/
flake.nix
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
{
description = "Wasabi wallet coordinator";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; }; #nixpkgs.legacyPackages.x86_64-linux;
deployScript = pkgs.writeScriptBin "deploy" (builtins.readFile ./Contrib/deploy.sh);
gitRev = if (builtins.hasAttr "rev" self) then self.rev else "dirty";
backend-build = pkgs.buildDotnetModule rec {
pname = "WalletWasabi.Backend";
version = "2.0.0-${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}-${gitRev}";
nugetDeps = ./deps.nix; # nix build .#packages.x86_64-linux.default.passthru.fetch-deps
dotnetFlags = [ "-p:CommitHash=${gitRev}" ];
runtimeDeps = [ pkgs.openssl pkgs.zlib ];
dotnet-sdk = pkgs.dotnetCorePackages.sdk_8_0;
selfContainedBuild = true;
src = ./.;
projectFile = "WalletWasabi.Backend/WalletWasabi.Backend.csproj";
executables = [ "WalletWasabi.Backend" ];
postInstall = ''
ln -s ${deployScript}/bin/deploy $out
'';
};
# dotnet trace
dotnet-trace = pkgs.buildDotnetGlobalTool {
pname = "dotnet-trace";
nugetName = "dotnet-trace";
version = "8.0.510501";
nugetSha256 = "sha256-Kt5x8n5Q0T+BaTVufhsyjXbi/BlGKidb97DWSbI6Iq8=";
dotnet-sdk = pkgs.dotnetCorePackages.sdk_8_0;
};
# dotnet dump
dotnet-dump = pkgs.buildDotnetGlobalTool {
pname = "dotnet-dump";
nugetName = "dotnet-dump";
version = "8.0.510501";
nugetSha256 = "sha256-H7Z4EA/9G3DvVuXbnQJF7IJMEB2SkzRjTAL3eZMqCpI=";
dotnet-sdk = pkgs.dotnetCorePackages.sdk_8_0;
};
# dotnet counters
dotnet-counters = pkgs.buildDotnetGlobalTool {
pname = "dotnet-counters";
nugetName = "dotnet-counters";
version = "8.0.510501";
nugetSha256 = "sha256-gAexbRzKP/8VPhFy2OqnUCp6ze3CkcWLYR1nUqG71PI=";
dotnet-sdk = pkgs.dotnetCorePackages.sdk_8_0;
};
wasabi-shell = pkgs.mkShell {
name = "wasabi-shell";
packages = [
pkgs.dotnetCorePackages.sdk_8_0
dotnet-trace
dotnet-dump
dotnet-counters
];
shellHook = ''
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1
export DOTNET_ROOT=${pkgs.dotnetCorePackages.sdk_8_0}
export PS1='\n\[\033[1;34m\][Wasabi:\w]\$\[\033[0m\] '
'';
};
in
{
packages.x86_64-linux.default = backend-build;
devShells.x86_64-linux.default = wasabi-shell;
};
}