-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.nix
More file actions
42 lines (36 loc) · 1.02 KB
/
release.nix
File metadata and controls
42 lines (36 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
36
37
38
39
40
41
42
##
# Nix derivation for CI purposes.
# Invoke as:
# nix-build release.nix \
# --argstr gitHash $(git rev-parse HEAD) \
# --argstr gitDescribe $(git describe)
#
# Windows builds are currently broken due to missing libuuid.
##
{ nixpkgs ? import <nixpkgs> {}, gitHash, gitDescribe }:
let
systems = nixpkgs.lib.systems.examples;
baseAgent = nixpkgs.callPackage ./default.nix {
inherit nixpkgs;
inherit gitHash;
inherit gitDescribe;
};
in rec {
musl64Static = baseAgent.override {
pkgs = (import <nixpkgs> { crossSystem = systems.musl64; }).pkgsStatic;
};
release = nixpkgs.stdenv.mkDerivation {
pname = "nimrodg-agent-release";
version = gitDescribe;
buildInputs = [ musl64Static ];
dontUnpack = true;
installPhase = ''
mkdir -p "$out"
cp "${musl64Static}/bin/agent-${musl64Static.platformString}" \
"$out/agent-${musl64Static.platformString}-${gitDescribe}"
cd "$out" && for i in *; do
sha256sum -b "$i" > "$i.sha256"
done
'';
};
}