-
-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (49 loc) · 1.57 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (49 loc) · 1.57 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
{
description = "Gonzo - Go-based TUI log analysis tool";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.gomod2nix.url = "github:nix-community/gomod2nix";
inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
outputs = {
self,
nixpkgs,
flake-utils,
gomod2nix,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
buildGoApplication = gomod2nix.legacyPackages.${system}.buildGoApplication;
in {
packages.default = buildGoApplication rec {
pname = "gonzo";
version = "0.1.5";
src = ./.;
modules = ./gomod2nix.toml;
# Create stub web/dist so //go:embed all:dist compiles
# Full web dashboard is built separately via `make build`
preBuild = ''
mkdir -p web/dist
echo '<!DOCTYPE html><html><body></body></html>' > web/dist/index.html
'';
ldflags = ["-s" "-w"];
meta = with pkgs.lib; {
description = "Go-based TUI for log analysis";
homepage = "https://github.com/control-theory/gonzo";
license = licenses.mit;
mainProgram = "gonzo";
platforms = platforms.unix;
};
};
apps.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/gonzo";
};
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.go
pkgs.git
gomod2nix.legacyPackages.${system}.gomod2nix
];
};
});
}