nix fmt
This commit is contained in:
parent
93749a66a9
commit
f6e47d592c
2 changed files with 30 additions and 4 deletions
|
|
@ -6,14 +6,24 @@
|
|||
}:
|
||||
let
|
||||
cfg = config.services.buildbot-nix.nix-build-autoscaler;
|
||||
defaultExtensionPackage =
|
||||
if builtins.hasAttr "buildbot-autoscale-ext" pkgs then
|
||||
pkgs."buildbot-autoscale-ext"
|
||||
else if
|
||||
builtins.hasAttr "python3Packages" pkgs
|
||||
&& builtins.hasAttr "buildbot-autoscale-ext" pkgs.python3Packages
|
||||
then
|
||||
pkgs.python3Packages."buildbot-autoscale-ext"
|
||||
else
|
||||
null;
|
||||
in
|
||||
{
|
||||
options.services.buildbot-nix.nix-build-autoscaler = {
|
||||
enable = lib.mkEnableOption "buildbot-nix autoscaler gate integration";
|
||||
|
||||
extensionPackage = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.buildbot-autoscale-ext;
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
default = defaultExtensionPackage;
|
||||
description = "Package providing buildbot_autoscale_ext.";
|
||||
};
|
||||
|
||||
|
|
@ -125,6 +135,13 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.extensionPackage != null;
|
||||
message = ''
|
||||
services.buildbot-nix.nix-build-autoscaler.extensionPackage is not set and
|
||||
pkgs.buildbot-autoscale-ext was not found. Configure extensionPackage explicitly.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.builderClusterHost != null;
|
||||
message = "services.buildbot-nix.nix-build-autoscaler.builderClusterHost must be set.";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue