···184184 </listitem>
185185 <listitem>
186186 <para>
187187+ The <literal>erigon</literal> ethereum node has moved to a new
188188+ database format in <literal>2021-05-04</literal>, and requires
189189+ a full resync
190190+ </para>
191191+ </listitem>
192192+ <listitem>
193193+ <para>
187194 <literal>services.geoip-updater</literal> was broken and has
188195 been replaced by
189196 <link xlink:href="options.html#opt-services.geoipupdate.enable">services.geoipupdate</link>.
+2
nixos/doc/manual/release-notes/rl-2111.section.md
···57575858- The `staticjinja` package has been upgraded from 1.0.4 to 3.0.1
59596060+- The `erigon` ethereum node has moved to a new database format in `2021-05-04`, and requires a full resync
6161+6062- `services.geoip-updater` was broken and has been replaced by [services.geoipupdate](options.html#opt-services.geoipupdate.enable).
61636264- PHP 7.3 is no longer supported due to upstream not supporting this version for the entire lifecycle of the 21.11 release.
···61616262 port = mkOption {
6363 default = 8080;
6464- type = types.int;
6464+ type = types.port;
6565 description = ''
6666 Specifies port number on which the jenkins HTTP interface listens.
6767 The default is 8080.
+1-1
nixos/modules/services/development/hoogle.nix
···1717 enable = mkEnableOption "Haskell documentation server";
18181919 port = mkOption {
2020- type = types.int;
2020+ type = types.port;
2121 default = 8080;
2222 description = ''
2323 Port number Hoogle will be listening to.
+1-1
nixos/modules/services/misc/home-assistant.nix
···78787979 port = mkOption {
8080 default = 8123;
8181- type = types.int;
8181+ type = types.port;
8282 description = "The port on which to listen.";
8383 };
8484
+83-151
nixos/modules/services/misc/uhub.nix
···33with lib;
4455let
66-77- cfg = config.services.uhub;
88-99- uhubPkg = pkgs.uhub.override { tlsSupport = cfg.enableTLS; };
1010-1111- pluginConfig = ""
1212- + optionalString cfg.plugins.authSqlite.enable ''
1313- plugin ${uhubPkg.mod_auth_sqlite}/mod_auth_sqlite.so "file=${cfg.plugins.authSqlite.file}"
1414- ''
1515- + optionalString cfg.plugins.logging.enable ''
1616- plugin ${uhubPkg.mod_logging}/mod_logging.so ${if cfg.plugins.logging.syslog then "syslog=true" else "file=${cfg.plugins.logging.file}"}
1717- ''
1818- + optionalString cfg.plugins.welcome.enable ''
1919- plugin ${uhubPkg.mod_welcome}/mod_welcome.so "motd=${pkgs.writeText "motd.txt" cfg.plugins.welcome.motd} rules=${pkgs.writeText "rules.txt" cfg.plugins.welcome.rules}"
2020- ''
2121- + optionalString cfg.plugins.history.enable ''
2222- plugin ${uhubPkg.mod_chat_history}/mod_chat_history.so "history_max=${toString cfg.plugins.history.max} history_default=${toString cfg.plugins.history.default} history_connect=${toString cfg.plugins.history.connect}"
2323- '';
2424-2525- uhubConfigFile = pkgs.writeText "uhub.conf" ''
2626- file_acl=${pkgs.writeText "users.conf" cfg.aclConfig}
2727- file_plugins=${pkgs.writeText "plugins.conf" pluginConfig}
2828- server_bind_addr=${cfg.address}
2929- server_port=${toString cfg.port}
3030- ${lib.optionalString cfg.enableTLS "tls_enable=yes"}
3131- ${cfg.hubConfig}
3232- '';
3333-3434-in
3535-3636-{
66+ settingsFormat = {
77+ type = with lib.types; attrsOf (oneOf [ bool int str ]);
88+ generate = name: attrs:
99+ pkgs.writeText name (lib.strings.concatStringsSep "\n"
1010+ (lib.attrsets.mapAttrsToList
1111+ (key: value: "${key}=${builtins.toJSON value}") attrs));
1212+ };
1313+in {
3714 options = {
38153939- services.uhub = {
1616+ services.uhub = mkOption {
1717+ default = { };
1818+ description = "Uhub ADC hub instances";
1919+ type = types.attrsOf (types.submodule {
2020+ options = {
40214141- enable = mkOption {
4242- type = types.bool;
4343- default = false;
4444- description = "Whether to enable the uhub ADC hub.";
4545- };
4646-4747- port = mkOption {
4848- type = types.int;
4949- default = 1511;
5050- description = "TCP port to bind the hub to.";
5151- };
2222+ enable = mkEnableOption "hub instance" // { default = true; };
52235353- address = mkOption {
5454- type = types.str;
5555- default = "any";
5656- description = "Address to bind the hub to.";
5757- };
5858-5959- enableTLS = mkOption {
6060- type = types.bool;
6161- default = false;
6262- description = "Whether to enable TLS support.";
6363- };
6464-6565- hubConfig = mkOption {
6666- type = types.lines;
6767- default = "";
6868- description = "Contents of uhub configuration file.";
6969- };
7070-7171- aclConfig = mkOption {
7272- type = types.lines;
7373- default = "";
7474- description = "Contents of user ACL configuration file.";
7575- };
7676-7777- plugins = {
7878-7979- authSqlite = {
8080- enable = mkOption {
2424+ enableTLS = mkOption {
8125 type = types.bool;
8226 default = false;
8383- description = "Whether to enable the Sqlite authentication database plugin";
8484- };
8585- file = mkOption {
8686- type = types.path;
8787- example = "/var/db/uhub-users";
8888- description = "Path to user database. Use the uhub-passwd utility to create the database and add/remove users.";
2727+ description = "Whether to enable TLS support.";
8928 };
9090- };
91299292- logging = {
9393- enable = mkOption {
9494- type = types.bool;
9595- default = false;
9696- description = "Whether to enable the logging plugin.";
9797- };
9898- file = mkOption {
9999- type = types.str;
100100- default = "";
101101- description = "Path of log file.";
102102- };
103103- syslog = mkOption {
104104- type = types.bool;
105105- default = false;
106106- description = "If true then the system log is used instead of writing to file.";
107107- };
108108- };
109109-110110- welcome = {
111111- enable = mkOption {
112112- type = types.bool;
113113- default = false;
114114- description = "Whether to enable the welcome plugin.";
115115- };
116116- motd = mkOption {
117117- default = "";
118118- type = types.lines;
3030+ settings = mkOption {
3131+ inherit (settingsFormat) type;
11932 description = ''
120120- Welcome message displayed to clients after connecting
121121- and with the <literal>!motd</literal> command.
3333+ Configuration of uhub.
3434+ See https://www.uhub.org/doc/config.php for a list of options.
12235 '';
3636+ default = { };
3737+ example = {
3838+ server_bind_addr = "any";
3939+ server_port = 1511;
4040+ hub_name = "My Public Hub";
4141+ hub_description = "Yet another ADC hub";
4242+ max_users = 150;
4343+ };
12344 };
124124- rules = mkOption {
125125- default = "";
126126- type = types.lines;
127127- description = ''
128128- Rules message, displayed to clients with the <literal>!rules</literal> command.
129129- '';
4545+4646+ plugins = mkOption {
4747+ description = "Uhub plugin configuration.";
4848+ type = with types;
4949+ listOf (submodule {
5050+ options = {
5151+ plugin = mkOption {
5252+ type = path;
5353+ example = literalExample
5454+ "$${pkgs.uhub}/plugins/mod_auth_sqlite.so";
5555+ description = "Path to plugin file.";
5656+ };
5757+ settings = mkOption {
5858+ description = "Settings specific to this plugin.";
5959+ type = with types; attrsOf str;
6060+ example = { file = "/etc/uhub/users.db"; };
6161+ };
6262+ };
6363+ });
6464+ default = [ ];
13065 };
131131- };
13266133133- history = {
134134- enable = mkOption {
135135- type = types.bool;
136136- default = false;
137137- description = "Whether to enable the history plugin.";
138138- };
139139- max = mkOption {
140140- type = types.int;
141141- default = 200;
142142- description = "The maximum number of messages to keep in history";
143143- };
144144- default = mkOption {
145145- type = types.int;
146146- default = 10;
147147- description = "When !history is provided without arguments, then this default number of messages are returned.";
148148- };
149149- connect = mkOption {
150150- type = types.int;
151151- default = 5;
152152- description = "The number of chat history messages to send when users connect (0 = do not send any history).";
153153- };
15467 };
155155-156156- };
6868+ });
15769 };
1587015971 };
16072161161- config = mkIf cfg.enable {
7373+ config = let
7474+ hubs = lib.attrsets.filterAttrs (_: cfg: cfg.enable) config.services.uhub;
7575+ in {
16276163163- users = {
164164- users.uhub.uid = config.ids.uids.uhub;
165165- groups.uhub.gid = config.ids.gids.uhub;
166166- };
7777+ environment.etc = lib.attrsets.mapAttrs' (name: cfg:
7878+ let
7979+ settings' = cfg.settings // {
8080+ tls_enable = cfg.enableTLS;
8181+ file_plugins = pkgs.writeText "uhub-plugins.conf"
8282+ (lib.strings.concatStringsSep "\n" (map ({ plugin, settings }:
8383+ "plugin ${plugin} ${
8484+ toString
8585+ (lib.attrsets.mapAttrsToList (key: value: ''"${key}=${value}"'')
8686+ settings)
8787+ }") cfg.plugins));
8888+ };
8989+ in {
9090+ name = "uhub/${name}.conf";
9191+ value.source = settingsFormat.generate "uhub-${name}.conf" settings';
9292+ }) hubs;
16793168168- systemd.services.uhub = {
169169- description = "high performance peer-to-peer hub for the ADC network";
170170- after = [ "network.target" ];
171171- wantedBy = [ "multi-user.target" ];
172172- serviceConfig = {
173173- Type = "notify";
174174- ExecStart = "${uhubPkg}/bin/uhub -c ${uhubConfigFile} -u uhub -g uhub -L";
175175- ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
9494+ systemd.services = lib.attrsets.mapAttrs' (name: cfg: {
9595+ name = "uhub-${name}";
9696+ value = let pkg = pkgs.uhub.override { tlsSupport = cfg.enableTLS; };
9797+ in {
9898+ description = "high performance peer-to-peer hub for the ADC network";
9999+ after = [ "network.target" ];
100100+ wantedBy = [ "multi-user.target" ];
101101+ reloadIfChanged = true;
102102+ serviceConfig = {
103103+ Type = "notify";
104104+ ExecStart = "${pkg}/bin/uhub -c /etc/uhub/${name}.conf -L";
105105+ ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
106106+ DynamicUser = true;
107107+ };
176108 };
177177- };
109109+ }) hubs;
178110 };
179111180112}
+2-2
nixos/modules/services/networking/i2pd.nix
···3232 description = "Bind address for ${name} endpoint.";
3333 };
3434 port = mkOption {
3535- type = types.int;
3535+ type = types.port;
3636 default = port;
3737- description = "Bind port for ${name} endoint.";
3737+ description = "Bind port for ${name} endpoint.";
3838 };
3939 };
4040
+1-1
nixos/modules/services/networking/shout.nix
···4141 };
42424343 port = mkOption {
4444- type = types.int;
4444+ type = types.port;
4545 default = 9000;
4646 description = "TCP port to listen on for http connections.";
4747 };
···2121 };
22222323 port = mkOption {
2424- type = types.int;
2424+ type = types.port;
2525 default = 8999;
2626 description = ''
2727 TCP port to bind to.
···4242 description = ''
4343 The interfaces <command>wpa_supplicant</command> will use. If empty, it will
4444 automatically use all wireless interfaces.
4545- <warning><para>
4646- The automatic discovery of interfaces does not work reliably on boot:
4747- it may fail and leave the system without network. When possible, specify
4848- a known interface name.
4949- </para></warning>
5045 '';
5146 };
5247···230225 message = ''options networking.wireless."${name}".{psk,pskRaw,auth} are mutually exclusive'';
231226 });
232227233233- warnings =
234234- optional (cfg.interfaces == [] && config.systemd.services.wpa_supplicant.wantedBy != [])
235235- ''
236236- No network interfaces for wpa_supplicant have been configured: the service
237237- may randomly fail to start at boot. You should specify at least one using the option
238238- networking.wireless.interfaces.
239239- '';
240240-241228 environment.systemPackages = [ package ];
242229243230 services.dbus.packages = [ package ];
···258245 wantedBy = [ "multi-user.target" ];
259246 stopIfChanged = false;
260247261261- path = [ package ];
248248+ path = [ package pkgs.udev ];
262249263250 script = let
264251 configStr = if cfg.allowAuxiliaryImperativeNetworks
265252 then "-c /etc/wpa_supplicant.conf -I ${configFile}"
266253 else "-c ${configFile}";
267254 in ''
268268- if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ]
269269- then echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
255255+ if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ]; then
256256+ echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
270257 fi
258258+271259 iface_args="-s -u -D${cfg.driver} ${configStr}"
260260+272261 ${if ifaces == [] then ''
273273- for i in $(cd /sys/class/net && echo *); do
274274- DEVTYPE=
275275- UEVENT_PATH=/sys/class/net/$i/uevent
276276- if [ -e "$UEVENT_PATH" ]; then
277277- source "$UEVENT_PATH"
278278- if [ "$DEVTYPE" = "wlan" -o -e /sys/class/net/$i/wireless ]; then
279279- args+="''${args:+ -N} -i$i $iface_args"
280280- fi
281281- fi
262262+ # detect interfaces automatically
263263+264264+ # check if there are no wireless interface
265265+ if ! find -H /sys/class/net/* -name wireless | grep -q .; then
266266+ # if so, wait until one appears
267267+ echo "Waiting for wireless interfaces"
268268+ grep -q '^ACTION=add' < <(stdbuf -oL -- udevadm monitor -s net/wlan -pu)
269269+ # Note: the above line has been carefully written:
270270+ # 1. The process substitution avoids udevadm hanging (after grep has quit)
271271+ # until it tries to write to the pipe again. Not even pipefail works here.
272272+ # 2. stdbuf is needed because udevadm output is buffered by default and grep
273273+ # may hang until more udev events enter the pipe.
274274+ fi
275275+276276+ # add any interface found to the daemon arguments
277277+ for name in $(find -H /sys/class/net/* -name wireless | cut -d/ -f 5); do
278278+ echo "Adding interface $name"
279279+ args+="''${args:+ -N} -i$name $iface_args"
282280 done
283281 '' else ''
282282+ # add known interfaces to the daemon arguments
284283 args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}"
285284 ''}
285285+286286+ # finally start daemon
286287 exec wpa_supplicant $args
287288 '';
288289 };
+2-2
nixos/modules/services/networking/zeronet.nix
···3232 };
33333434 port = mkOption {
3535- type = types.int;
3535+ type = types.port;
3636 default = 43110;
3737 example = 43110;
3838 description = "Optional zeronet web UI port.";
···4141 fileserverPort = mkOption {
4242 # Not optional: when absent zeronet tries to write one to the
4343 # read-only config file and crashes
4444- type = types.int;
4444+ type = types.port;
4545 default = 12261;
4646 example = 12261;
4747 description = "Zeronet fileserver port.";
···22, pkgs
33, lib
44, buildBowerComponents
55+, fetchbower
56, fetchurl
67, nodejs
78}:
···1213 inherit (stdenv.hostPlatform) system;
1314 };
14151515- bowerPackages = buildBowerComponents {
1616+ bowerPackages = (buildBowerComponents {
1617 name = "${cryptpad.name}-bower-packages";
1717- # this list had to be tweaked by hand:
1818- # * add the second jquery ~2.1.0 entry
1919- # * add the second bootstrap ~3.1.1 entry
2018 generated = ./bower-packages.nix;
2119 src = cryptpad.src;
2222- };
2020+ }).overrideAttrs (old: {
2121+ bowerPackages = old.bowerPackages.override (old_: {
2222+ # add missing dependencies:
2323+ # Those dependencies are EOL and they are not installed by buildBowerComponents,
2424+ # but they are required, otherwise the resolver crashes.
2525+ # * add the second jquery ~2.1.0 entry
2626+ # * add the second bootstrap ~3.1.1 entry
2727+ paths = old_.paths ++ [
2828+ (fetchbower "jquery" "2.1.0" "~2.1.0" "02kwvz93vzpv10qnp7s0dz3al0jh77awwrizb6wadsvgifxssnlr")
2929+ (fetchbower "bootstrap" "3.1.1" "~3.1.1" "06bhjwa8p7mzbpr3jkgydd804z1nwrkdql66h7jkfml99psv9811")
3030+ ];
3131+ });
3232+ });
23332434 # find an element in an attribute set
2535 findValue = pred: default: set:
2636 let
2737 list =
2838 lib.concatMap
2929- (name:
3030- let v = set.${name}; in
3131- if pred name v then [v] else []
3232- )
3333- (lib.attrNames set)
3434- ;
3939+ (name:
4040+ let v = set.${name}; in
4141+ if pred name v then [ v ] else [ ]
4242+ )
4343+ (lib.attrNames set)
4444+ ;
3545 in
3636- if list == [] then default
3737- else lib.head list
3838- ;
4646+ if list == [ ] then default
4747+ else lib.head list
4848+ ;
39494050 # The cryptpad package attribute key changes for each release. Get it out
4151 # programatically instead.
···4353 (k: v: v.packageName == "cryptpad")
4454 (throw "cryptpad not found")
4555 nodePackages
4646- ;
5656+ ;
47574858 combined = cryptpad.override {
4959 postInstall = ''
···6474 EOF
6575 chmod +x $out/bin/cryptpad
6676 '';
7777+7878+ meta = {
7979+ longDescription = ''
8080+ CryptPad is a collaboration suite that is end-to-end-encrypted and open-source.
8181+ It is built to enable collaboration, synchronizing changes to documents in real time.
8282+ Because all data is encrypted, the service and its administrators have no way of seeing the content being edited and stored.
8383+ '';
8484+ maintainers = with lib.maintainers; [ davhau ];
8585+ mainProgram = "cryptpad";
8686+ };
8787+6788 };
6889in
6969- combined
9090+combined