-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
51 lines (43 loc) · 1.5 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
51
{
description = "A Nix flake for the haproxytime utility.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, ... }:
let
configRevision = {
full = if (self ? rev) then self.rev else if (self ? dirtyRev) then self.dirtyRev else "dirty";
short = if (self ? rev) then self.shortRev else if (self ? dirtyRev) then self.dirtyShortRev else "dirty";
lastModifiedDate = self.lastModifiedDate;
};
forAllSystems = function: nixpkgs.lib.genAttrs [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ] (
system: function system
);
in {
defaultPackage = forAllSystems (system: self.packages.${system}.haproxytime);
checks = forAllSystems (system: {
build = self.defaultPackage.${system};
});
devShells = forAllSystems (system: let
pkgs = (import nixpkgs { inherit system; });
in {
default = pkgs.mkShell {
buildInputs = [
self.packages.${system}.default.buildInputs
self.packages.${system}.default.nativeBuildInputs
];
};
});
overlays.default = final: prev: {
haproxytime = prev.callPackage ./package.nix { inherit configRevision; };
};
packages = forAllSystems (system: rec {
haproxytime = (import nixpkgs { inherit system; overlays = [ self.overlays.default ]; }).haproxytime;
default = haproxytime;
});
};
}