Skip to content

Commit b0e2dd6

Browse files
committed
Add buildbot module using NixOS compat
Signed-off-by: magic_rb <[email protected]>
1 parent 245a57c commit b0e2dd6

File tree

5 files changed

+193
-9
lines changed

5 files changed

+193
-9
lines changed

flake.lock

Lines changed: 109 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
{
1010
inputs = {
1111
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-24.05";
12+
buildbot-nix.url = "github:nix-community/buildbot-nix";
1213
treefmt-nix.url = "github:numtide/treefmt-nix";
1314
};
1415

@@ -17,7 +18,8 @@
1718
nixpkgs,
1819
self,
1920
treefmt-nix,
20-
}:
21+
...
22+
}@inputs:
2123
let
2224
supportedSystems = [
2325
"x86_64-linux"
@@ -40,7 +42,10 @@
4042
inherit (nixpkgs.lib) recurseIntoAttrs;
4143
in
4244
{
43-
nglib = import ./lib nixpkgs.lib;
45+
nglib = import ./lib {
46+
inherit (nixpkgs) lib;
47+
inherit inputs;
48+
};
4449
examples = import ./examples {
4550
inherit nixpkgs;
4651
inherit (self) nglib;

lib/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
lib:
1+
{ lib, inputs }:
22
lib.fix (
33
nglib:
44
let
@@ -93,6 +93,6 @@ lib.fix (
9393
getOptionFromPath
9494
;
9595

96-
makeSystem = import ./make-system.nix { inherit lib nglib overlay; };
96+
makeSystem = import ./make-system.nix { inherit nglib overlay inputs; };
9797
}
9898
)

lib/make-system.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
88

99
# These arguments are provided by the overarching NixNG repository and are not user confugurable.
10-
{ nglib, overlay, ... }:
10+
{
11+
nglib,
12+
overlay,
13+
inputs,
14+
}:
1115
# These arguments are user configurable
1216
{
1317
nixpkgs,
@@ -26,6 +30,7 @@ let
2630
inherit nglib;
2731
__enableExperimentalNixOSCompatibility =
2832
specialArgs.__enableExperimentalNixOSCompatibility or false;
33+
nixngInputs = inputs;
2934
};
3035

3136
modules =

modules/nixos/buildbot.nix

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{ lib, nixngInputs, ... }:
2+
let
3+
buildbotMasterModule =
4+
nixngInputs.nixpkgs + "/nixos/modules/services/continuous-integration/buildbot/master.nix";
5+
buildbotWorkerModule =
6+
nixngInputs.nixpkgs + "/nixos/modules/services/continuous-integration/buildbot/worker.nix";
7+
in
8+
{
9+
options.nixos = lib.mkOption {
10+
type = lib.types.submodule {
11+
imports = [
12+
buildbotMasterModule
13+
buildbotWorkerModule
14+
nixngInputs.buildbot-nix.nixosModules.buildbot-master
15+
nixngInputs.buildbot-nix.nixosModules.buildbot-worker
16+
];
17+
};
18+
};
19+
imports = [
20+
(lib.mkAliasOptionModule
21+
[
22+
"services"
23+
"buildbot-master"
24+
]
25+
[
26+
"nixos"
27+
"services"
28+
"buildbot-master"
29+
]
30+
)
31+
(lib.mkAliasOptionModule
32+
[
33+
"services"
34+
"buildbot-worker"
35+
]
36+
[
37+
"nixos"
38+
"services"
39+
"buildbot-worker"
40+
]
41+
)
42+
(lib.mkAliasOptionModule
43+
[
44+
"services"
45+
"buildbot-nix"
46+
"master"
47+
]
48+
[
49+
"nixos"
50+
"services"
51+
"buildbot-nix"
52+
"master"
53+
]
54+
)
55+
(lib.mkAliasOptionModule
56+
[
57+
"services"
58+
"buildbot-nix"
59+
"worker"
60+
]
61+
[
62+
"nixos"
63+
"services"
64+
"buildbot-nix"
65+
"worker"
66+
]
67+
)
68+
];
69+
}

0 commit comments

Comments
 (0)