diff options
6 files changed, 25 insertions, 5 deletions
diff --git a/nixos/modules/services/backup/tarsnap.nix b/nixos/modules/services/backup/tarsnap.nix index 9cce8683661..4dfd0a1dffb 100644 --- a/nixos/modules/services/backup/tarsnap.nix +++ b/nixos/modules/services/backup/tarsnap.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, utils, ... }: +{ config, lib, options, pkgs, utils, ... }: with lib; let gcfg = config.services.tarsnap; + opt = options.services.tarsnap; configFile = name: cfg: '' keyfile ${cfg.keyfile} @@ -65,6 +66,7 @@ in keyfile = mkOption { type = types.str; default = gcfg.keyfile; + defaultText = literalExpression "config.${opt.keyfile}"; description = '' Set a specific keyfile for this archive. This defaults to <literal>"/root/tarsnap.key"</literal> if left unspecified. diff --git a/nixos/modules/services/monitoring/zabbix-proxy.nix b/nixos/modules/services/monitoring/zabbix-proxy.nix index b5009f47f17..0ebd7bcff83 100644 --- a/nixos/modules/services/monitoring/zabbix-proxy.nix +++ b/nixos/modules/services/monitoring/zabbix-proxy.nix @@ -1,7 +1,8 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: let cfg = config.services.zabbixProxy; + opt = options.services.zabbixProxy; pgsql = config.services.postgresql; mysql = config.services.mysql; @@ -103,6 +104,11 @@ in port = mkOption { type = types.int; default = if cfg.database.type == "mysql" then mysql.port else pgsql.port; + defaultText = literalExpression '' + if config.${opt.database.type} == "mysql" + then config.${options.services.mysql.port} + else config.${options.services.postgresql.port} + ''; description = "Database host port."; }; diff --git a/nixos/modules/services/monitoring/zabbix-server.nix b/nixos/modules/services/monitoring/zabbix-server.nix index 0141c073da2..9f960517a81 100644 --- a/nixos/modules/services/monitoring/zabbix-server.nix +++ b/nixos/modules/services/monitoring/zabbix-server.nix @@ -1,7 +1,8 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: let cfg = config.services.zabbixServer; + opt = options.services.zabbixServer; pgsql = config.services.postgresql; mysql = config.services.mysql; @@ -95,6 +96,11 @@ in port = mkOption { type = types.int; default = if cfg.database.type == "mysql" then mysql.port else pgsql.port; + defaultText = literalExpression '' + if config.${opt.database.type} == "mysql" + then config.${options.services.mysql.port} + else config.${options.services.postgresql.port} + ''; description = "Database host port."; }; diff --git a/nixos/modules/services/web-apps/pgpkeyserver-lite.nix b/nixos/modules/services/web-apps/pgpkeyserver-lite.nix index 5642627d397..faf0ce13238 100644 --- a/nixos/modules/services/web-apps/pgpkeyserver-lite.nix +++ b/nixos/modules/services/web-apps/pgpkeyserver-lite.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; @@ -6,6 +6,7 @@ let cfg = config.services.pgpkeyserver-lite; sksCfg = config.services.sks; + sksOpt = options.services.sks; webPkg = cfg.package; @@ -37,6 +38,7 @@ in hkpAddress = mkOption { default = builtins.head sksCfg.hkpAddress; + defaultText = literalExpression "head config.${sksOpt.hkpAddress}"; type = types.str; description = " Wich ip address the sks-keyserver is listening on. @@ -45,6 +47,7 @@ in hkpPort = mkOption { default = sksCfg.hkpPort; + defaultText = literalExpression "config.${sksOpt.hkpPort}"; type = types.int; description = " Which port the sks-keyserver is listening on. diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 58e4fe04f37..92b3af8527f 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -148,6 +148,7 @@ in xauthBin = mkOption { internal = true; default = "${xorg.xauth}/bin/xauth"; + defaultText = literalExpression ''"''${pkgs.xorg.xauth}/bin/xauth"''; description = "Path to the <command>xauth</command> program used by display managers."; }; diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index a9100da1aa4..3bc0dedec00 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, utils, ... }: +{ config, lib, options, pkgs, utils, ... }: # # TODO: zfs tunables @@ -8,6 +8,7 @@ with lib; let cfgZfs = config.boot.zfs; + optZfs = options.boot.zfs; cfgExpandOnBoot = config.services.zfs.expandOnBoot; cfgSnapshots = config.services.zfs.autoSnapshot; cfgSnapFlags = cfgSnapshots.flags; @@ -347,6 +348,7 @@ in services.zfs.zed = { enableMail = mkEnableOption "ZED's ability to send emails" // { default = cfgZfs.package.enableMail; + defaultText = literalExpression "config.${optZfs.package}.enableMail"; }; settings = mkOption { |