-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
50 lines (50 loc) · 1.37 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
{
description = "Fleet - Ephemeral HTTP API tunnel";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
outputs = { self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
version = "24.01";
in
{
formatter.${system} = pkgs.nixpkgs-fmt;
packages.${system} = rec {
fleet = pkgs.buildGoModule {
pname = "fleet";
version = version;
src = ./.;
vendorHash = "sha256-TM9ZfQ/YfSYdLbdhDgJUMHbhFfm+iOc70zVRKclAjf0=";
CGO_ENABLED = 0;
subPackages = [ "cmd/fleet" ];
nativeBuildInputs = [ pkgs.installShellFiles ];
postInstall = ''
for shell in bash zsh; do
installShellCompletion --$shell ./cli/completion/$shell/fleet
done
'';
};
dockerImage = pkgs.dockerTools.buildImage {
name = "murtazau/fleet";
tag = version;
config = {
Cmd = [ "${fleet}/bin/fleet" "run" ];
WorkingDir = "/data";
};
};
default = fleet;
};
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
go
go-tools
gopls
protobuf
protoc-gen-go
protoc-gen-go-grpc
grpcurl
openssl
];
};
};
}