forked from pranshuparmar/witr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
35 lines (35 loc) · 1.02 KB
/
Copy pathflake.nix
File metadata and controls
35 lines (35 loc) · 1.02 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
};
outputs =
{ self, nixpkgs }:
{
packages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ] (
system:
let
pkgs = import nixpkgs { inherit system; };
version = "0.1.0";
commit = if self ? rev then self.rev else "dirty";
buildDate = pkgs.lib.concatStringsSep "-" [
(builtins.substring 0 4 self.lastModifiedDate)
(builtins.substring 4 2 self.lastModifiedDate)
(builtins.substring 6 2 self.lastModifiedDate)
];
in
{
default = pkgs.buildGoModule {
pname = "witr";
inherit version;
src = pkgs.lib.cleanSource ./.;
vendorHash = null;
ldflags = [
"-X main.version=v${version}"
"-X main.commit=${commit}"
"-X main.buildDate=${buildDate}"
];
};
}
);
};
}