-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
41 lines (37 loc) · 1.23 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
{
description = "Karavel CLI tool";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
trim = s: nixpkgs.lib.strings.removePrefix " v" (nixpkgs.lib.strings.removeSuffix " " (nixpkgs.lib.removeSuffix "\n" s));
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
version = trim (builtins.readFile ./VERSION);
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.default = pkgs.buildGoModule {
pname = "karavel";
version = "v${version}";
src = ./.;
subPackages = [ "cmd/karavel" ];
ldflags = [
"-X github.com/karavel-io/cli/internal/version.version=${version}"
];
vendorSha256 = "sha256-8Ty26vr/J1SgY/+W4ZpMM1RpxrXesByXRTylOqgpYuc=";
};
apps.default = utils.lib.mkApp { drv = self.packages.${system}.default; };
devShells.default = pkgs.mkShell
{
buildInputs = with pkgs; [
go_1_18
addlicense
gnumake
goreleaser
];
};
});
}