also introduce buildbotNixpkgs for buildbot-worker module

This commit is contained in:
Jörg Thalheim 2024-07-14 18:20:59 +02:00 committed by mergify[bot]
parent b896d5fb7f
commit 93942c0a66
2 changed files with 7 additions and 3 deletions

View file

@ -29,7 +29,7 @@
nixosModules.buildbot-worker.imports = [
./nix/worker.nix
({ pkgs, ... }: {
services.buildbot-nix.worker.package = lib.mkDefault inputs.nixpkgs.legacyPackages.${pkgs.hostPlatform.system}.buildbot-worker;
services.buildbot-nix.worker.buildbotNixpkgs = lib.mkDefault inputs.nixpkgs.legacyPackages.${pkgs.hostPlatform.system};
})
];

View file

@ -19,9 +19,13 @@ in
default = config.networking.hostName;
description = "The buildbot worker name.";
};
buildbotNixpkgs = lib.mkOption {
type = lib.types.raw;
description = "Nixpkgs to use for buildbot packages";
};
package = lib.mkOption {
type = lib.types.package;
default = pkgs.buildbot-worker;
default = cfg.buildbotNixpkgs.buildbot-worker;
defaultText = "pkgs.buildbot-worker";
description = "The buildbot-worker package to use.";
};
@ -88,7 +92,7 @@ in
# Restart buildbot with a delay. This time way we can use buildbot to deploy itself.
ExecReload = "+${config.systemd.package}/bin/systemd-run --on-active=60 ${config.systemd.package}/bin/systemctl restart buildbot-worker";
ExecStart = lib.traceIf
(lib.versionOlder pkgs.buildbot-worker.version "4.0.0")
(lib.versionOlder cfg.package.version "4.0.0")
''
`buildbot-nix` recommends `buildbot-worker` to be at least of version `4.0.0`.
Consider upgrading by setting `services.buildbot-nix.worker.package` i.e. from nixpkgs-unstable.