0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

modules: add mkPackageOptionMD

another transitional option factory, like mkAliasOptionModuleMD.
This commit is contained in:
pennae 2022-12-30 21:04:52 +01:00 committed by pennae
parent 4c1cfbdb84
commit 9da5f12ecf
23 changed files with 42 additions and 24 deletions

View file

@ -50,7 +50,7 @@ let
(name: value:
let
wholeName = "${namePrefix}.${name}";
guard = lib.warn "Attempt to evaluate package ${wholeName} in option documentation; this is not supported and will eventually be an error. Use `mkPackageOption` or `literalExpression` instead.";
guard = lib.warn "Attempt to evaluate package ${wholeName} in option documentation; this is not supported and will eventually be an error. Use `mkPackageOption{,MD}` or `literalExpression` instead.";
in if isAttrs value then
scrubDerivations wholeName value
// optionalAttrs (isDerivation value) {

View file

@ -27,7 +27,7 @@ in
'';
};
package = mkPackageOption pkgs "1Password GUI" {
package = mkPackageOptionMD pkgs "1Password GUI" {
default = [ "_1password-gui" ];
};
};

View file

@ -18,7 +18,7 @@ in
programs._1password = {
enable = mkEnableOption (lib.mdDoc "the 1Password CLI tool");
package = mkPackageOption pkgs "1Password CLI" {
package = mkPackageOptionMD pkgs "1Password CLI" {
default = [ "_1password" ];
};
};

View file

@ -16,7 +16,7 @@ in
group.
'';
};
package = mkPackageOption pkgs "flashrom" { };
package = mkPackageOptionMD pkgs "flashrom" { };
};
config = mkIf cfg.enable {

View file

@ -1,6 +1,6 @@
{ pkgs, config, lib, ... }:
let
inherit (lib) mdDoc mkEnableOption mkPackageOption optional optionalString;
inherit (lib) mdDoc mkEnableOption mkPackageOptionMD optional optionalString;
cfg = config.programs.skim;
in
{
@ -8,7 +8,7 @@ in
programs.skim = {
fuzzyCompletion = mkEnableOption (mdDoc "fuzzy completion with skim");
keybindings = mkEnableOption (mdDoc "skim keybindings");
package = mkPackageOption pkgs "skim" {};
package = mkPackageOptionMD pkgs "skim" {};
};
};

View file

@ -15,7 +15,7 @@ in
description = lib.mdDoc "Whether streamdeck-ui should be started automatically.";
};
package = mkPackageOption pkgs "streamdeck-ui" {
package = mkPackageOptionMD pkgs "streamdeck-ui" {
default = [ "streamdeck-ui" ];
};

View file

@ -55,7 +55,7 @@ in
services.dgraph = {
enable = mkEnableOption (lib.mdDoc "Dgraph native GraphQL database with a graph backend");
package = lib.mkPackageOption pkgs "dgraph" { };
package = lib.mkPackageOptionMD pkgs "dgraph" { };
settings = mkOption {
type = settingsFormat.type;

View file

@ -128,7 +128,7 @@ in {
'';
};
};
package = mkPackageOption pkgs "listmonk" {};
package = mkPackageOptionMD pkgs "listmonk" {};
settings = mkOption {
type = types.submodule { freeformType = tomlFormat.type; };
description = lib.mdDoc ''

View file

@ -7,7 +7,7 @@ let cfg = config.services.input-remapper; in
options = {
services.input-remapper = {
enable = mkEnableOption (lib.mdDoc "input-remapper, an easy to use tool to change the mapping of your input device buttons.");
package = options.mkPackageOption pkgs "input-remapper" { };
package = mkPackageOptionMD pkgs "input-remapper" { };
enableUdevRules = mkEnableOption (lib.mdDoc "udev rules added by input-remapper to handle hotplugged devices. Currently disabled by default due to https://github.com/sezanzeb/input-remapper/issues/140");
serviceWantedBy = mkOption {
default = [ "graphical.target" ];

View file

@ -13,7 +13,7 @@ in
services.polaris = {
enable = mkEnableOption (lib.mdDoc "Polaris Music Server");
package = mkPackageOption pkgs "polaris" { };
package = mkPackageOptionMD pkgs "polaris" { };
user = mkOption {
type = types.str;

View file

@ -116,7 +116,7 @@ let
};
in {
options.networking.openconnect = {
package = mkPackageOption pkgs "openconnect" { };
package = mkPackageOptionMD pkgs "openconnect" { };
interfaces = mkOption {
description = lib.mdDoc "OpenConnect interfaces.";

View file

@ -14,7 +14,7 @@ in
enable = mkEnableOption (lib.mdDoc "ShellHub Agent daemon");
package = mkPackageOption pkgs "shellhub-agent" { };
package = mkPackageOptionMD pkgs "shellhub-agent" { };
preferredHostname = mkOption {
type = types.str;

View file

@ -71,7 +71,7 @@ in
services.vdirsyncer = {
enable = mkEnableOption (mdDoc "vdirsyncer");
package = mkPackageOption pkgs "vdirsyncer" {};
package = mkPackageOptionMD pkgs "vdirsyncer" {};
jobs = mkOption {
description = mdDoc "vdirsyncer job configurations";

View file

@ -36,7 +36,7 @@ in {
which execute configured commands for any person or service that knows the URL
'');
package = mkPackageOption pkgs "webhook" {};
package = mkPackageOptionMD pkgs "webhook" {};
user = mkOption {
type = types.str;
default = defaultUser;

View file

@ -174,7 +174,7 @@ in
};
};
package = mkPackageOption pkgs "transmission" {};
package = mkPackageOptionMD pkgs "transmission" {};
downloadDirPermissions = mkOption {
type = with types; nullOr str;

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mdDoc mkEnableOption mkIf mkPackageOption singleton;
inherit (lib) mdDoc mkEnableOption mkIf mkPackageOptionMD singleton;
cfg = config.services.xserver.windowManager.katriawm;
in
{
@ -9,7 +9,7 @@ in
options = {
services.xserver.windowManager.katriawm = {
enable = mkEnableOption (mdDoc "katriawm");
package = mkPackageOption pkgs "katriawm" {};
package = mkPackageOptionMD pkgs "katriawm" {};
};
};

View file

@ -10,7 +10,7 @@ in
options.services.xserver.windowManager.qtile = {
enable = mkEnableOption (lib.mdDoc "qtile");
package = mkPackageOption pkgs "qtile" { };
package = mkPackageOptionMD pkgs "qtile" { };
};
config = mkIf cfg.enable {

View file

@ -142,7 +142,7 @@ in {
'';
};
package = (mkPackageOption pkgs "systemd" {
package = (mkPackageOptionMD pkgs "systemd" {
default = "systemdStage1";
}) // {
visible = false;