-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
flake.nix
104 lines (91 loc) · 3.14 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
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
{
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};
tex = pkgs.texlive.combine {
inherit (pkgs.texlive)
scheme-small
adjustbox
biber
biblatex
cleveref
csquotes
fontsetup
hyperxmp
latexmk
luacode
lualatex-math
menukeys
newcomputermodern
relsize
siunitx
soul
xstring
;
};
in
{
packages.gotraceui = pkgs.buildGo121Module {
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.manual = pkgs.stdenvNoCC.mkDerivation rec {
name = "manual";
src = self;
buildInputs = [ tex ];
buildPhase = ''
mkdir -p .cache/texmf-var
export TEXMFHOME=.cache
export TEXMFVAR=.cache/texmf-var
latexmk -cd -f -pdf -lualatex -interaction=nonstopmode -bibtex-cond1 doc/manual/manual.tex
'';
installPhase = ''
mkdir -p $out
cp doc/manual/manual.pdf $out/gotraceui.pdf
'';
};
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;
}
);
}