forked from zimeg/git-coverage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
57 lines (57 loc) · 1.54 KB
/
flake.nix
File metadata and controls
57 lines (57 loc) · 1.54 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
{
description = "open test coverage in a web browser";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ nixpkgs, ... }:
let
each =
function:
nixpkgs.lib.genAttrs [
"x86_64-darwin"
"x86_64-linux"
"aarch64-darwin"
"aarch64-linux"
] (system: function nixpkgs.legacyPackages.${system});
in
{
devShells = each (
pkgs:
let
kcov = if pkgs.stdenv.isLinux then pkgs.kcov else null;
in
{
default = pkgs.mkShell {
packages = [
pkgs.git # https://github.com/git/git
pkgs.goreleaser # https://github.com/goreleaser/goreleaser
kcov # https://github.com/SimonKagstrom/kcov
pkgs.zig # https://github.com/ziglang/zig
];
shellHook = ''
export ZIG_GLOBAL_CACHE_DIR="$PWD/.zig-cache"
mkdir -p "$ZIG_GLOBAL_CACHE_DIR"
'';
};
}
);
packages = each (pkgs: {
default = pkgs.stdenv.mkDerivation {
pname = "git-coverage";
version = "unversioned";
src = ./.;
nativeBuildInputs = [
pkgs.installShellFiles
pkgs.zig.hook
];
zigBuildFlags = [ "-Doptimize=ReleaseSmall" ];
installPhase = ''
mkdir -p $out/bin
cp zig-out/bin/git-coverage $out/bin/
installManPage man/git-coverage.1
'';
};
});
};
}