···11 filter
12 foldl'
13 head
014 isAttrs
15 isBool
16 isDerivation
···144 if def.value != first.value then
145 throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}"
146 else
147- first) (head defs) defs).value;
148149 /* Extracts values of all "value" keys of the given list.
150
···11 filter
12 foldl'
13 head
14+ tail
15 isAttrs
16 isBool
17 isDerivation
···145 if def.value != first.value then
146 throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}"
147 else
148+ first) (head defs) (tail defs)).value;
149150 /* Extracts values of all "value" keys of the given list.
151
···184 </listitem>
185 <listitem>
186 <para>
0000000187 <literal>services.geoip-updater</literal> was broken and has
188 been replaced by
189 <link xlink:href="options.html#opt-services.geoipupdate.enable">services.geoipupdate</link>.
···184 </listitem>
185 <listitem>
186 <para>
187+ The <literal>erigon</literal> ethereum node has moved to a new
188+ database format in <literal>2021-05-04</literal>, and requires
189+ a full resync
190+ </para>
191+ </listitem>
192+ <listitem>
193+ <para>
194 <literal>services.geoip-updater</literal> was broken and has
195 been replaced by
196 <link xlink:href="options.html#opt-services.geoipupdate.enable">services.geoipupdate</link>.
+2
nixos/doc/manual/release-notes/rl-2111.section.md
···5758- The `staticjinja` package has been upgraded from 1.0.4 to 3.0.1
590060- `services.geoip-updater` was broken and has been replaced by [services.geoipupdate](options.html#opt-services.geoipupdate.enable).
6162- PHP 7.3 is no longer supported due to upstream not supporting this version for the entire lifecycle of the 21.11 release.
···5758- The `staticjinja` package has been upgraded from 1.0.4 to 3.0.1
5960+- The `erigon` ethereum node has moved to a new database format in `2021-05-04`, and requires a full resync
61+62- `services.geoip-updater` was broken and has been replaced by [services.geoipupdate](options.html#opt-services.geoipupdate.enable).
6364- PHP 7.3 is no longer supported due to upstream not supporting this version for the entire lifecycle of the 21.11 release.
···6162 port = mkOption {
63 default = 8080;
64- type = types.int;
65 description = ''
66 Specifies port number on which the jenkins HTTP interface listens.
67 The default is 8080.
···6162 port = mkOption {
63 default = 8080;
64+ type = types.port;
65 description = ''
66 Specifies port number on which the jenkins HTTP interface listens.
67 The default is 8080.
+1-1
nixos/modules/services/development/hoogle.nix
···17 enable = mkEnableOption "Haskell documentation server";
1819 port = mkOption {
20- type = types.int;
21 default = 8080;
22 description = ''
23 Port number Hoogle will be listening to.
···17 enable = mkEnableOption "Haskell documentation server";
1819 port = mkOption {
20+ type = types.port;
21 default = 8080;
22 description = ''
23 Port number Hoogle will be listening to.
+1-1
nixos/modules/services/misc/home-assistant.nix
···7879 port = mkOption {
80 default = 8123;
81- type = types.int;
82 description = "The port on which to listen.";
83 };
84
···7879 port = mkOption {
80 default = 8123;
81+ type = types.port;
82 description = "The port on which to listen.";
83 };
84
+83-151
nixos/modules/services/misc/uhub.nix
···3with lib;
45let
6-7- cfg = config.services.uhub;
8-9- uhubPkg = pkgs.uhub.override { tlsSupport = cfg.enableTLS; };
10-11- pluginConfig = ""
12- + optionalString cfg.plugins.authSqlite.enable ''
13- plugin ${uhubPkg.mod_auth_sqlite}/mod_auth_sqlite.so "file=${cfg.plugins.authSqlite.file}"
14- ''
15- + optionalString cfg.plugins.logging.enable ''
16- plugin ${uhubPkg.mod_logging}/mod_logging.so ${if cfg.plugins.logging.syslog then "syslog=true" else "file=${cfg.plugins.logging.file}"}
17- ''
18- + optionalString cfg.plugins.welcome.enable ''
19- 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}"
20- ''
21- + optionalString cfg.plugins.history.enable ''
22- 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}"
23- '';
24-25- uhubConfigFile = pkgs.writeText "uhub.conf" ''
26- file_acl=${pkgs.writeText "users.conf" cfg.aclConfig}
27- file_plugins=${pkgs.writeText "plugins.conf" pluginConfig}
28- server_bind_addr=${cfg.address}
29- server_port=${toString cfg.port}
30- ${lib.optionalString cfg.enableTLS "tls_enable=yes"}
31- ${cfg.hubConfig}
32- '';
33-34-in
35-36-{
37 options = {
3839- services.uhub = {
00004041- enable = mkOption {
42- type = types.bool;
43- default = false;
44- description = "Whether to enable the uhub ADC hub.";
45- };
46-47- port = mkOption {
48- type = types.int;
49- default = 1511;
50- description = "TCP port to bind the hub to.";
51- };
5253- address = mkOption {
54- type = types.str;
55- default = "any";
56- description = "Address to bind the hub to.";
57- };
58-59- enableTLS = mkOption {
60- type = types.bool;
61- default = false;
62- description = "Whether to enable TLS support.";
63- };
64-65- hubConfig = mkOption {
66- type = types.lines;
67- default = "";
68- description = "Contents of uhub configuration file.";
69- };
70-71- aclConfig = mkOption {
72- type = types.lines;
73- default = "";
74- description = "Contents of user ACL configuration file.";
75- };
76-77- plugins = {
78-79- authSqlite = {
80- enable = mkOption {
81 type = types.bool;
82 default = false;
83- description = "Whether to enable the Sqlite authentication database plugin";
84- };
85- file = mkOption {
86- type = types.path;
87- example = "/var/db/uhub-users";
88- description = "Path to user database. Use the uhub-passwd utility to create the database and add/remove users.";
89 };
90- };
9192- logging = {
93- enable = mkOption {
94- type = types.bool;
95- default = false;
96- description = "Whether to enable the logging plugin.";
97- };
98- file = mkOption {
99- type = types.str;
100- default = "";
101- description = "Path of log file.";
102- };
103- syslog = mkOption {
104- type = types.bool;
105- default = false;
106- description = "If true then the system log is used instead of writing to file.";
107- };
108- };
109-110- welcome = {
111- enable = mkOption {
112- type = types.bool;
113- default = false;
114- description = "Whether to enable the welcome plugin.";
115- };
116- motd = mkOption {
117- default = "";
118- type = types.lines;
119 description = ''
120- Welcome message displayed to clients after connecting
121- and with the <literal>!motd</literal> command.
122 '';
00000000123 };
124- rules = mkOption {
125- default = "";
126- type = types.lines;
127- description = ''
128- Rules message, displayed to clients with the <literal>!rules</literal> command.
129- '';
00000000000000130 };
131- };
132133- history = {
134- enable = mkOption {
135- type = types.bool;
136- default = false;
137- description = "Whether to enable the history plugin.";
138- };
139- max = mkOption {
140- type = types.int;
141- default = 200;
142- description = "The maximum number of messages to keep in history";
143- };
144- default = mkOption {
145- type = types.int;
146- default = 10;
147- description = "When !history is provided without arguments, then this default number of messages are returned.";
148- };
149- connect = mkOption {
150- type = types.int;
151- default = 5;
152- description = "The number of chat history messages to send when users connect (0 = do not send any history).";
153- };
154 };
155-156- };
157 };
158159 };
160161- config = mkIf cfg.enable {
00162163- users = {
164- users.uhub.uid = config.ids.uids.uhub;
165- groups.uhub.gid = config.ids.gids.uhub;
166- };
000000000000167168- systemd.services.uhub = {
169- description = "high performance peer-to-peer hub for the ADC network";
170- after = [ "network.target" ];
171- wantedBy = [ "multi-user.target" ];
172- serviceConfig = {
173- Type = "notify";
174- ExecStart = "${uhubPkg}/bin/uhub -c ${uhubConfigFile} -u uhub -g uhub -L";
175- ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
000000176 };
177- };
178 };
179180}
···42 description = ''
43 The interfaces <command>wpa_supplicant</command> will use. If empty, it will
44 automatically use all wireless interfaces.
45- <warning><para>
46- The automatic discovery of interfaces does not work reliably on boot:
47- it may fail and leave the system without network. When possible, specify
48- a known interface name.
49- </para></warning>
50 '';
51 };
52···230 message = ''options networking.wireless."${name}".{psk,pskRaw,auth} are mutually exclusive'';
231 });
232233- warnings =
234- optional (cfg.interfaces == [] && config.systemd.services.wpa_supplicant.wantedBy != [])
235- ''
236- No network interfaces for wpa_supplicant have been configured: the service
237- may randomly fail to start at boot. You should specify at least one using the option
238- networking.wireless.interfaces.
239- '';
240-241 environment.systemPackages = [ package ];
242243 services.dbus.packages = [ package ];
···258 wantedBy = [ "multi-user.target" ];
259 stopIfChanged = false;
260261- path = [ package ];
262263 script = let
264 configStr = if cfg.allowAuxiliaryImperativeNetworks
265 then "-c /etc/wpa_supplicant.conf -I ${configFile}"
266 else "-c ${configFile}";
267 in ''
268- if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ]
269- then echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
270 fi
0271 iface_args="-s -u -D${cfg.driver} ${configStr}"
0272 ${if ifaces == [] then ''
273- for i in $(cd /sys/class/net && echo *); do
274- DEVTYPE=
275- UEVENT_PATH=/sys/class/net/$i/uevent
276- if [ -e "$UEVENT_PATH" ]; then
277- source "$UEVENT_PATH"
278- if [ "$DEVTYPE" = "wlan" -o -e /sys/class/net/$i/wireless ]; then
279- args+="''${args:+ -N} -i$i $iface_args"
280- fi
281- fi
000000000282 done
283 '' else ''
0284 args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}"
285 ''}
00286 exec wpa_supplicant $args
287 '';
288 };
···42 description = ''
43 The interfaces <command>wpa_supplicant</command> will use. If empty, it will
44 automatically use all wireless interfaces.
0000045 '';
46 };
47···225 message = ''options networking.wireless."${name}".{psk,pskRaw,auth} are mutually exclusive'';
226 });
22700000000228 environment.systemPackages = [ package ];
229230 services.dbus.packages = [ package ];
···245 wantedBy = [ "multi-user.target" ];
246 stopIfChanged = false;
247248+ path = [ package pkgs.udev ];
249250 script = let
251 configStr = if cfg.allowAuxiliaryImperativeNetworks
252 then "-c /etc/wpa_supplicant.conf -I ${configFile}"
253 else "-c ${configFile}";
254 in ''
255+ if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ]; then
256+ echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
257 fi
258+259 iface_args="-s -u -D${cfg.driver} ${configStr}"
260+261 ${if ifaces == [] then ''
262+ # detect interfaces automatically
263+264+ # check if there are no wireless interface
265+ if ! find -H /sys/class/net/* -name wireless | grep -q .; then
266+ # if so, wait until one appears
267+ echo "Waiting for wireless interfaces"
268+ grep -q '^ACTION=add' < <(stdbuf -oL -- udevadm monitor -s net/wlan -pu)
269+ # Note: the above line has been carefully written:
270+ # 1. The process substitution avoids udevadm hanging (after grep has quit)
271+ # until it tries to write to the pipe again. Not even pipefail works here.
272+ # 2. stdbuf is needed because udevadm output is buffered by default and grep
273+ # may hang until more udev events enter the pipe.
274+ fi
275+276+ # add any interface found to the daemon arguments
277+ for name in $(find -H /sys/class/net/* -name wireless | cut -d/ -f 5); do
278+ echo "Adding interface $name"
279+ args+="''${args:+ -N} -i$name $iface_args"
280 done
281 '' else ''
282+ # add known interfaces to the daemon arguments
283 args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}"
284 ''}
285+286+ # finally start daemon
287 exec wpa_supplicant $args
288 '';
289 };
+2-2
nixos/modules/services/networking/zeronet.nix
···32 };
3334 port = mkOption {
35- type = types.int;
36 default = 43110;
37 example = 43110;
38 description = "Optional zeronet web UI port.";
···41 fileserverPort = mkOption {
42 # Not optional: when absent zeronet tries to write one to the
43 # read-only config file and crashes
44- type = types.int;
45 default = 12261;
46 example = 12261;
47 description = "Zeronet fileserver port.";
···32 };
3334 port = mkOption {
35+ type = types.port;
36 default = 43110;
37 example = 43110;
38 description = "Optional zeronet web UI port.";
···41 fileserverPort = mkOption {
42 # Not optional: when absent zeronet tries to write one to the
43 # read-only config file and crashes
44+ type = types.port;
45 default = 12261;
46 example = 12261;
47 description = "Zeronet fileserver port.";
···2, pkgs
3, lib
4, buildBowerComponents
05, fetchurl
6, nodejs
7}:
···12 inherit (stdenv.hostPlatform) system;
13 };
1415- bowerPackages = buildBowerComponents {
16 name = "${cryptpad.name}-bower-packages";
17- # this list had to be tweaked by hand:
18- # * add the second jquery ~2.1.0 entry
19- # * add the second bootstrap ~3.1.1 entry
20 generated = ./bower-packages.nix;
21 src = cryptpad.src;
22- };
0000000000002324 # find an element in an attribute set
25 findValue = pred: default: set:
26 let
27 list =
28 lib.concatMap
29- (name:
30- let v = set.${name}; in
31- if pred name v then [v] else []
32- )
33- (lib.attrNames set)
34- ;
35 in
36- if list == [] then default
37- else lib.head list
38- ;
3940 # The cryptpad package attribute key changes for each release. Get it out
41 # programatically instead.
···43 (k: v: v.packageName == "cryptpad")
44 (throw "cryptpad not found")
45 nodePackages
46- ;
4748 combined = cryptpad.override {
49 postInstall = ''
···64 EOF
65 chmod +x $out/bin/cryptpad
66 '';
0000000000067 };
68in
69- combined
···2, pkgs
3, lib
4, buildBowerComponents
5+, fetchbower
6, fetchurl
7, nodejs
8}:
···13 inherit (stdenv.hostPlatform) system;
14 };
1516+ bowerPackages = (buildBowerComponents {
17 name = "${cryptpad.name}-bower-packages";
00018 generated = ./bower-packages.nix;
19 src = cryptpad.src;
20+ }).overrideAttrs (old: {
21+ bowerPackages = old.bowerPackages.override (old_: {
22+ # add missing dependencies:
23+ # Those dependencies are EOL and they are not installed by buildBowerComponents,
24+ # but they are required, otherwise the resolver crashes.
25+ # * add the second jquery ~2.1.0 entry
26+ # * add the second bootstrap ~3.1.1 entry
27+ paths = old_.paths ++ [
28+ (fetchbower "jquery" "2.1.0" "~2.1.0" "02kwvz93vzpv10qnp7s0dz3al0jh77awwrizb6wadsvgifxssnlr")
29+ (fetchbower "bootstrap" "3.1.1" "~3.1.1" "06bhjwa8p7mzbpr3jkgydd804z1nwrkdql66h7jkfml99psv9811")
30+ ];
31+ });
32+ });
3334 # find an element in an attribute set
35 findValue = pred: default: set:
36 let
37 list =
38 lib.concatMap
39+ (name:
40+ let v = set.${name}; in
41+ if pred name v then [ v ] else [ ]
42+ )
43+ (lib.attrNames set)
44+ ;
45 in
46+ if list == [ ] then default
47+ else lib.head list
48+ ;
4950 # The cryptpad package attribute key changes for each release. Get it out
51 # programatically instead.
···53 (k: v: v.packageName == "cryptpad")
54 (throw "cryptpad not found")
55 nodePackages
56+ ;
5758 combined = cryptpad.override {
59 postInstall = ''
···74 EOF
75 chmod +x $out/bin/cryptpad
76 '';
77+78+ meta = {
79+ longDescription = ''
80+ CryptPad is a collaboration suite that is end-to-end-encrypted and open-source.
81+ It is built to enable collaboration, synchronizing changes to documents in real time.
82+ Because all data is encrypted, the service and its administrators have no way of seeing the content being edited and stored.
83+ '';
84+ maintainers = with lib.maintainers; [ davhau ];
85+ mainProgram = "cryptpad";
86+ };
87+88 };
89in
90+combined