mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package type, to be `mkPackageOption`, in order to reduce the amount of code.
This commit is contained in:
parent
9cc575741d
commit
0a37316d6c
377 changed files with 606 additions and 2786 deletions
|
@ -229,12 +229,8 @@ in {
|
|||
description = lib.mdDoc "Specifies port number on which the buildbot HTTP interface listens.";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.buildbot-full;
|
||||
defaultText = literalExpression "pkgs.buildbot-full";
|
||||
description = lib.mdDoc "Package to use for buildbot.";
|
||||
example = literalExpression "pkgs.buildbot";
|
||||
package = mkPackageOption pkgs "buildbot-full" {
|
||||
example = "buildbot";
|
||||
};
|
||||
|
||||
packages = mkOption {
|
||||
|
|
|
@ -128,12 +128,8 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.buildbot-worker;
|
||||
defaultText = literalExpression "pkgs.python3Packages.buildbot-worker";
|
||||
description = lib.mdDoc "Package to use for buildbot worker.";
|
||||
example = literalExpression "pkgs.python2Packages.buildbot-worker";
|
||||
package = mkPackageOption pkgs "python3Packages.buildbot-worker" {
|
||||
example = "python2Packages.buildbot-worker";
|
||||
};
|
||||
|
||||
packages = mkOption {
|
||||
|
|
|
@ -161,14 +161,7 @@ with lib;
|
|||
default = {};
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = lib.mdDoc ''
|
||||
Which github-runner derivation to use.
|
||||
'';
|
||||
default = pkgs.github-runner;
|
||||
defaultText = literalExpression "pkgs.github-runner";
|
||||
};
|
||||
package = mkPackageOption pkgs "github-runner" { };
|
||||
|
||||
ephemeral = mkOption {
|
||||
type = types.bool;
|
||||
|
|
|
@ -195,12 +195,8 @@ in {
|
|||
Time to wait until a graceful shutdown is turned into a forceful one.
|
||||
'';
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.gitlab-runner;
|
||||
defaultText = literalExpression "pkgs.gitlab-runner";
|
||||
example = literalExpression "pkgs.gitlab-runner_1_11";
|
||||
description = lib.mdDoc "Gitlab Runner package to use.";
|
||||
package = mkPackageOption pkgs "gitlab-runner" {
|
||||
example = "gitlab-runner_1_11";
|
||||
};
|
||||
extraPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
|
|
|
@ -16,7 +16,7 @@ let
|
|||
mkRemovedOptionModule
|
||||
mkRenamedOptionModule
|
||||
types
|
||||
|
||||
mkPackageOption
|
||||
;
|
||||
|
||||
cfg = config.services.hercules-ci-agent;
|
||||
|
@ -45,14 +45,7 @@ in
|
|||
Support is available at [help@hercules-ci.com](mailto:help@hercules-ci.com).
|
||||
'';
|
||||
};
|
||||
package = mkOption {
|
||||
description = lib.mdDoc ''
|
||||
Package containing the bin/hercules-ci-agent executable.
|
||||
'';
|
||||
type = types.package;
|
||||
default = pkgs.hercules-ci-agent;
|
||||
defaultText = literalExpression "pkgs.hercules-ci-agent";
|
||||
};
|
||||
package = mkPackageOption pkgs "hercules-ci-agent" { };
|
||||
settings = mkOption {
|
||||
description = lib.mdDoc ''
|
||||
These settings are written to the `agent.toml` file.
|
||||
|
|
|
@ -97,12 +97,7 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.hydra_unstable;
|
||||
defaultText = literalExpression "pkgs.hydra_unstable";
|
||||
description = lib.mdDoc "The Hydra package.";
|
||||
};
|
||||
package = mkPackageOption pkgs "hydra_unstable" { };
|
||||
|
||||
hydraURL = mkOption {
|
||||
type = types.str;
|
||||
|
|
|
@ -79,12 +79,7 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
default = pkgs.jenkins;
|
||||
defaultText = literalExpression "pkgs.jenkins";
|
||||
type = types.package;
|
||||
description = lib.mdDoc "Jenkins package to use.";
|
||||
};
|
||||
package = mkPackageOption pkgs "jenkins" { };
|
||||
|
||||
packages = mkOption {
|
||||
default = [ pkgs.stdenv pkgs.git pkgs.jdk17 config.programs.ssh.package pkgs.nix ];
|
||||
|
|
|
@ -47,14 +47,7 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
javaPackage = mkOption {
|
||||
default = pkgs.jdk;
|
||||
defaultText = literalExpression "pkgs.jdk";
|
||||
description = lib.mdDoc ''
|
||||
Java package to install.
|
||||
'';
|
||||
type = types.package;
|
||||
};
|
||||
javaPackage = mkPackageOption pkgs "jdk" { };
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue