-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
59 lines (48 loc) · 1.61 KB
/
flake.nix
File metadata and controls
59 lines (48 loc) · 1.61 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
57
58
59
{
description = "Ctrlplane CLI (ctrlc)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
version =
if (self ? rev)
then self.shortRev
else "dev";
in
{
packages = {
ctrlc = pkgs.buildGoModule {
pname = "ctrlc";
inherit version;
src = ./.;
vendorHash = "sha256-n/yfb1cCeQmfECyKsjsdsEYJM/rTip3d5mzMHXOHEDY=";
subPackages = [ "cmd/ctrlc" ];
env.CGO_ENABLED = "0";
tags = [ "containers_image_openpgp" ];
ldflags = [
"-s" "-w"
"-X github.com/ctrlplanedev/cli/cmd/ctrlc/root/version.Version=${version}"
"-X github.com/ctrlplanedev/cli/cmd/ctrlc/root/version.GitCommit=${self.rev or "dirty"}"
"-X github.com/ctrlplanedev/cli/cmd/ctrlc/root/version.BuildDate=1970-01-01T00:00:00Z"
];
meta = with pkgs.lib; {
description = "CLI for Ctrlplane - manage deployments, resources, and jobs";
homepage = "https://github.com/ctrlplanedev/cli";
mainProgram = "ctrlc";
};
};
default = self.packages.${system}.ctrlc;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_24
golangci-lint
goreleaser
];
};
});
}