-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
78 lines (67 loc) · 2.36 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
description = "generate reproducible random permutations using public randomness";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.hercules-ci-effects.flakeModule
];
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
# NOTE: I do not have runners for darwin
herculesCI.ciSystems = ["x86_64-linux" "aarch64-linux"];
hercules-ci.flake-update.enable = true;
hercules-ci.flake-update.when.dayOfWeek = "Sat";
perSystem = {pkgs, ...}: let
implementations.dshuf-go = pkgs.buildGoModule rec {
pname = "dshuf-go";
version = "unstable";
# workaround: src is a mandatory argument
src = builtins.path {
path = ./go;
# workaround: a source called go is confused with GOPATH
name = "src";
};
srcs = [
src
./testcases
];
sourceRoot = "src";
vendorHash = "sha256-GbicbJmyrQRiTW4byF3lkM01fMhclkIdSgub/C4rzQw=";
};
implementations.dshuf-rust = with pkgs;
rustPlatform.buildRustPackage {
pname = "dshuf-rust";
version = "unstable";
srcs = [./rust ./testcases];
sourceRoot = "rust";
cargoHash = "sha256-xD8gINh6B3yXae7SjatVBzLo3+KD2xToXQFheF5eyM8=";
buildInputs = [
openssl.dev
];
nativeBuildInputs = [
pkg-config
];
};
in {
packages = implementations;
devShells.default = with pkgs;
mkShell {
buildInputs = [
# To compile curl under Rust
openssl.dev
pkg-config
];
};
formatter = pkgs.alejandra;
checks = pkgs.lib.genAttrs ["go" "rust"] (impl:
pkgs.buildGoModule {
name = "dshuf-${impl}-check";
src = ./integration;
vendorHash = "sha256-1p3dCLLo+MTPxf/Y3zjxTagUi+tq7nZSj4ZB/aakJGY=";
nativeCheckInputs = [implementations."dshuf-${impl}"];
checkFlags = ["-test.run" "/impl=${impl}"];
});
};
};
}