blob: 3b1bcf520269b2180f23c63cdd6594d5ba6e3f62 (
plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
};
outputs =
{
self,
nixpkgs,
...
}@inputs:
let
supportedSystems = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
devShell = forAllSystems (system: inputs.self.devShells.${system}.default);
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
default = pkgs.mkShell {
name = "tickborg-dev";
nativeBuildInputs = with pkgs; [
bash
rustc
cargo
clippy
rustfmt
pkg-config
git
cmake
];
buildInputs =
with pkgs;
lib.optionals stdenv.isDarwin [
darwin.Security
libiconv
];
postHook = ''
checkPhase() (
cd "${builtins.toString ./.}/ofborg"
set -x
cargo fmt
git diff --exit-code
cargofmtexit=$?
cargo clippy
cargoclippyexit=$?
cargo build && cargo test
cargotestexit=$?
sum=$((cargofmtexit + cargoclippyexit + cargotestexit))
exit $sum
)
'';
RUSTFLAGS = "-D warnings";
RUST_BACKTRACE = "1";
RUST_LOG = "tickborg=debug";
};
}
);
packages = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
pkg = pkgs.rustPlatform.buildRustPackage {
name = "tickborg";
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
nativeBuildInputs = with pkgs; [
pkg-config
pkgs.rustPackages.clippy
];
preBuild = ''
cargo clippy
'';
doCheck = false;
checkInputs = with pkgs; [ ];
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"hubcaps-0.6.2" = "sha256-Vl4wQIKQVRxkpQxL8fL9rndAN3TKLV4OjgnZOpT6HRo=";
"hyperx-1.4.0" = "sha256-MW/KxxMYvj/DYVKrYa7rDKwrH6s8uQOCA0dR2W7GBeg=";
};
};
};
in
{
inherit pkg;
default = pkg;
tickborg = pkgs.runCommand "tickborg-rs" { src = pkg; } ''
mkdir -p $out/bin
for f in $(find $src -type f); do
bn=$(basename "$f")
ln -s "$f" "$out/bin/$bn"
# Cargo outputs bins with dashes; create underscore symlinks
if echo "$bn" | grep -q "-"; then
ln -s "$f" "$out/bin/$(echo "$bn" | tr '-' '_')"
fi
done
test -e $out/bin/builder
test -e $out/bin/github_comment_filter
test -e $out/bin/github_comment_poster
test -e $out/bin/github_webhook_receiver
test -e $out/bin/log_message_collector
test -e $out/bin/evaluation_filter
'';
}
);
hydraJobs = {
buildRs = forAllSystems (system: self.packages.${system}.tickborg);
};
};
}
|