diff options
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r-- | nixos/modules/services/networking/amuled.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/networking/ergo.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/networking/firewall.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/networking/jibri/default.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/networking/ntopng.nix | 7 | ||||
-rw-r--r-- | nixos/modules/services/networking/quassel.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/networking/quorum.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/networking/syncthing.nix | 24 | ||||
-rw-r--r-- | nixos/modules/services/networking/wasabibackend.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/networking/wireguard.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/networking/wpa_supplicant.nix | 4 |
11 files changed, 55 insertions, 15 deletions
diff --git a/nixos/modules/services/networking/amuled.nix b/nixos/modules/services/networking/amuled.nix index 39320643dd5..e55ac7a6b18 100644 --- a/nixos/modules/services/networking/amuled.nix +++ b/nixos/modules/services/networking/amuled.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.services.amule; + opt = options.services.amule; user = if cfg.user != null then cfg.user else "amule"; in @@ -26,6 +27,9 @@ in dataDir = mkOption { type = types.str; default = "/home/${user}/"; + defaultText = literalExpression '' + "/home/''${config.${opt.user}}/" + ''; description = '' The directory holding configuration, incoming and temporary files. ''; diff --git a/nixos/modules/services/networking/ergo.nix b/nixos/modules/services/networking/ergo.nix index c52de30dc36..6e55a7cfff6 100644 --- a/nixos/modules/services/networking/ergo.nix +++ b/nixos/modules/services/networking/ergo.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: let cfg = config.services.ergo; + opt = options.services.ergo; - inherit (lib) mkEnableOption mkIf mkOption optionalString types; + inherit (lib) literalExpression mkEnableOption mkIf mkOption optionalString types; configFile = pkgs.writeText "ergo.conf" ('' ergo { @@ -92,6 +93,7 @@ in { group = mkOption { type = types.str; default = cfg.user; + defaultText = literalExpression "config.${opt.user}"; description = "The group as which to run the Ergo node."; }; diff --git a/nixos/modules/services/networking/firewall.nix b/nixos/modules/services/networking/firewall.nix index b5b46fe6042..ff023a888f2 100644 --- a/nixos/modules/services/networking/firewall.nix +++ b/nixos/modules/services/networking/firewall.nix @@ -421,6 +421,7 @@ in checkReversePath = mkOption { type = types.either types.bool (types.enum ["strict" "loose"]); default = kernelHasRPFilter; + defaultText = literalDocBook "<literal>true</literal> if supported by the chosen kernel"; example = "loose"; description = '' diff --git a/nixos/modules/services/networking/jibri/default.nix b/nixos/modules/services/networking/jibri/default.nix index 96832b0eb55..113a7aa4384 100644 --- a/nixos/modules/services/networking/jibri/default.nix +++ b/nixos/modules/services/networking/jibri/default.nix @@ -132,7 +132,7 @@ in pkgs.writeScript "finalize_recording.sh" '''''' #!/bin/sh RECORDINGS_DIR=$1 - ${pkgs.rclone}/bin/rclone copy $RECORDINGS_DIR RCLONE_REMOTE:jibri-recordings/ -v --log-file=/var/log/jitsi/jibri/recording-upload.txt + ''${pkgs.rclone}/bin/rclone copy $RECORDINGS_DIR RCLONE_REMOTE:jibri-recordings/ -v --log-file=/var/log/jitsi/jibri/recording-upload.txt exit 0 ''''''; ''; diff --git a/nixos/modules/services/networking/ntopng.nix b/nixos/modules/services/networking/ntopng.nix index c1525711713..77a004e8ab3 100644 --- a/nixos/modules/services/networking/ntopng.nix +++ b/nixos/modules/services/networking/ntopng.nix @@ -1,10 +1,11 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.services.ntopng; + opt = options.services.ntopng; redisCfg = config.services.redis; configFile = if cfg.configText != "" then @@ -35,8 +36,8 @@ in collection tool. With the default configuration, ntopng monitors all network - interfaces and displays its findings at http://localhost:${toString - cfg.http-port}. Default username and password is admin/admin. + interfaces and displays its findings at http://localhost:''${toString + config.${opt.http-port}}. Default username and password is admin/admin. See the ntopng(8) manual page and http://www.ntop.org/products/ntop/ for more info. diff --git a/nixos/modules/services/networking/quassel.nix b/nixos/modules/services/networking/quassel.nix index 22940ef7a13..844c9a6b8b3 100644 --- a/nixos/modules/services/networking/quassel.nix +++ b/nixos/modules/services/networking/quassel.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.services.quassel; + opt = options.services.quassel; quassel = cfg.package; user = if cfg.user != null then cfg.user else "quassel"; in @@ -63,6 +64,9 @@ in dataDir = mkOption { default = "/home/${user}/.config/quassel-irc.org"; + defaultText = literalExpression '' + "/home/''${config.${opt.user}}/.config/quassel-irc.org" + ''; type = types.str; description = '' The directory holding configuration files, the SQlite database and the SSL Cert. diff --git a/nixos/modules/services/networking/quorum.nix b/nixos/modules/services/networking/quorum.nix index 50148dc314d..bddcd18c7fb 100644 --- a/nixos/modules/services/networking/quorum.nix +++ b/nixos/modules/services/networking/quorum.nix @@ -1,9 +1,10 @@ -{ config, pkgs, lib, ... }: +{ config, options, pkgs, lib, ... }: let inherit (lib) mkEnableOption mkIf mkOption literalExpression types optionalString; cfg = config.services.quorum; + opt = options.services.quorum; dataDir = "/var/lib/quorum"; genesisFile = pkgs.writeText "genesis.json" (builtins.toJSON cfg.genesis); staticNodesFile = pkgs.writeText "static-nodes.json" (builtins.toJSON cfg.staticNodes); @@ -23,6 +24,7 @@ in { group = mkOption { type = types.str; default = cfg.user; + defaultText = literalExpression "config.${opt.user}"; description = "The group as which to run quorum."; }; diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index 8c44687a382..e37e324019e 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.services.syncthing; + opt = options.services.syncthing; defaultUser = "syncthing"; defaultGroup = defaultUser; @@ -431,7 +432,26 @@ in { The path where the settings and keys will exist. ''; default = cfg.dataDir + optionalString cond "/.config/syncthing"; - defaultText = literalExpression "dataDir${optionalString cond " + \"/.config/syncthing\""}"; + defaultText = literalDocBook '' + <variablelist> + <varlistentry> + <term><literal>stateVersion >= 19.03</literal></term> + <listitem> + <programlisting> + config.${opt.dataDir} + "/.config/syncthing" + </programlisting> + </listitem> + </varlistentry> + <varlistentry> + <term>otherwise</term> + <listitem> + <programlisting> + config.${opt.dataDir} + </programlisting> + </listitem> + </varlistentry> + </variablelist> + ''; }; extraFlags = mkOption { diff --git a/nixos/modules/services/networking/wasabibackend.nix b/nixos/modules/services/networking/wasabibackend.nix index 8482823e197..b6dcd940915 100644 --- a/nixos/modules/services/networking/wasabibackend.nix +++ b/nixos/modules/services/networking/wasabibackend.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: let cfg = config.services.wasabibackend; + opt = options.services.wasabibackend; - inherit (lib) mkEnableOption mkIf mkOption optionalAttrs optionalString types; + inherit (lib) literalExpression mkEnableOption mkIf mkOption optionalAttrs optionalString types; confOptions = { BitcoinRpcConnectionString = "${cfg.rpc.user}:${cfg.rpc.password}"; @@ -103,6 +104,7 @@ in { group = mkOption { type = types.str; default = cfg.user; + defaultText = literalExpression "config.${opt.user}"; description = "The group as which to run the wasabibackend node."; }; }; diff --git a/nixos/modules/services/networking/wireguard.nix b/nixos/modules/services/networking/wireguard.nix index 55b84935b6c..7cd44b2f8a0 100644 --- a/nixos/modules/services/networking/wireguard.nix +++ b/nixos/modules/services/networking/wireguard.nix @@ -1,10 +1,11 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.networking.wireguard; + opt = options.networking.wireguard; kernel = config.boot.kernelPackages; @@ -438,6 +439,7 @@ in type = types.bool; # 2019-05-25: Backwards compatibility. default = cfg.interfaces != {}; + defaultText = literalExpression "config.${opt.interfaces} != { }"; example = true; }; diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix index 4aa350d21a2..07dec8ea718 100644 --- a/nixos/modules/services/networking/wpa_supplicant.nix +++ b/nixos/modules/services/networking/wpa_supplicant.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, utils, ... }: +{ config, lib, options, pkgs, utils, ... }: with lib; @@ -8,6 +8,7 @@ let else pkgs.wpa_supplicant; cfg = config.networking.wireless; + opt = options.networking.wireless; # Content of wpa_supplicant.conf generatedConfig = concatStringsSep "\n" ( @@ -421,6 +422,7 @@ in { dbusControlled = mkOption { type = types.bool; default = lib.length cfg.interfaces < 2; + defaultText = literalExpression "length config.${opt.interfaces} < 2"; description = '' Whether to enable the DBus control interface. This is only needed when using NetworkManager or connman. |