-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathflake.nix
64 lines (55 loc) · 2.13 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem ["x86_64-linux" "x86_64-darwin" "aarch64-darwin"] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.gotraceui = pkgs.buildGo123Module {
name = "gotraceui";
src = self;
vendorHash = "sha256-lszJObdEN6/Mo94btf5AD6W5dmTx7ciQgJWgQZ05UiU=";
subPackages = ["cmd/gotraceui"];
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = with pkgs;
(if stdenv.isLinux then [
vulkan-headers
libxkbcommon
wayland
xorg.libX11
xorg.libXcursor
xorg.libXfixes
libGL
] else if stdenv.isDarwin then [
darwin.apple_sdk_11_0.frameworks.Foundation
darwin.apple_sdk_11_0.frameworks.Metal
darwin.apple_sdk_11_0.frameworks.QuartzCore
darwin.apple_sdk_11_0.frameworks.AppKit
darwin.apple_sdk_11_0.MacOSX-SDK
] else [ ]);
ldflags = ["-X gioui.org/app.ID=co.honnef.Gotraceui"];
postInstall = ''
cp -r share $out/
'';
meta = with nixpkgs.lib; {
description = "An efficient frontend for Go execution traces";
homepage = "https://github.com/dominikh/gotraceui";
license = licenses.mit;
platforms = platforms.all;
};
};
packages.default = self.packages.${system}.gotraceui;
apps.gotraceui = flake-utils.lib.mkApp { drv = self.packages.${system}.gotraceui; };
apps.default = self.apps.${system}.gotraceui;
devShells.gotraceui = pkgs.mkShell {
inputsFrom = builtins.attrValues self.packages.${system};
nativeBuildInputs = [ pkgs.python3Packages.fonttools ];
};
devShells.default = self.devShells.${system}.gotraceui;
}
);
}