···41 };
4243 voiceIP = mkOption {
44- type = types.str;
45- default = "0.0.0.0";
046 description = ''
47 IP on which the server instance will listen for incoming voice connections. Defaults to any IP.
48 '';
···57 };
5859 fileTransferIP = mkOption {
60- type = types.str;
61- default = "0.0.0.0";
062 description = ''
63 IP on which the server instance will listen for incoming file transfer connections. Defaults to any IP.
64 '';
···73 };
7475 queryIP = mkOption {
76- type = types.str;
77- default = "0.0.0.0";
078 description = ''
79 IP on which the server instance will listen for incoming ServerQuery connections. Defaults to any IP.
80 '';
···122 ExecStart = ''
123 ${ts3}/bin/ts3server \
124 dbsqlpath=${ts3}/lib/teamspeak/sql/ logpath=${cfg.logPath} \
125- voice_ip=${cfg.voiceIP} default_voice_port=${toString cfg.defaultVoicePort} \
126- filetransfer_ip=${cfg.fileTransferIP} filetransfer_port=${toString cfg.fileTransferPort} \
127- query_ip=${cfg.queryIP} query_port=${toString cfg.queryPort} license_accepted=1
000128 '';
129 WorkingDirectory = cfg.dataDir;
130 User = user;
···41 };
4243 voiceIP = mkOption {
44+ type = types.nullOr types.str;
45+ default = null;
46+ example = "0.0.0.0";
47 description = ''
48 IP on which the server instance will listen for incoming voice connections. Defaults to any IP.
49 '';
···58 };
5960 fileTransferIP = mkOption {
61+ type = types.nullOr types.str;
62+ default = null;
63+ example = "0.0.0.0";
64 description = ''
65 IP on which the server instance will listen for incoming file transfer connections. Defaults to any IP.
66 '';
···75 };
7677 queryIP = mkOption {
78+ type = types.nullOr types.str;
79+ default = null;
80+ example = "0.0.0.0";
81 description = ''
82 IP on which the server instance will listen for incoming ServerQuery connections. Defaults to any IP.
83 '';
···125 ExecStart = ''
126 ${ts3}/bin/ts3server \
127 dbsqlpath=${ts3}/lib/teamspeak/sql/ logpath=${cfg.logPath} \
128+ ${optionalString (cfg.voiceIP != null) "voice_ip=${cfg.voiceIP}"} \
129+ default_voice_port=${toString cfg.defaultVoicePort} \
130+ ${optionalString (cfg.fileTransferIP != null) "filetransfer_ip=${cfg.fileTransferIP}"} \
131+ filetransfer_port=${toString cfg.fileTransferPort} \
132+ ${optionalString (cfg.queryIP != null) "query_ip=${cfg.queryIP}"} \
133+ query_port=${toString cfg.queryPort} license_accepted=1
134 '';
135 WorkingDirectory = cfg.dataDir;
136 User = user;
···21 type = types.int;
2223 description = ''
24- Idle time to wait until xautolock locks the computer.
25 '';
26 };
27
···21 type = types.int;
2223 description = ''
24+ Idle time (in minutes) to wait until xautolock locks the computer.
25 '';
26 };
27
+3-1
nixos/modules/system/boot/systemd.nix
···321 in concatMapStrings (n:
322 let s = optionalString (env."${n}" != null)
323 "Environment=${builtins.toJSON "${n}=${env.${n}}"}\n";
324- in if stringLength s >= 2048 then throw "The value of the environment variable ‘${n}’ in systemd service ‘${name}.service’ is too long." else s) (attrNames env)}
00325 ${if def.reloadIfChanged then ''
326 X-ReloadIfChanged=true
327 '' else if !def.restartIfChanged then ''
···321 in concatMapStrings (n:
322 let s = optionalString (env."${n}" != null)
323 "Environment=${builtins.toJSON "${n}=${env.${n}}"}\n";
324+ # systemd max line length is now 1MiB
325+ # https://github.com/systemd/systemd/commit/e6dde451a51dc5aaa7f4d98d39b8fe735f73d2af
326+ in if stringLength s >= 1048576 then throw "The value of the environment variable ‘${n}’ in systemd service ‘${name}.service’ is too long." else s) (attrNames env)}
327 ${if def.reloadIfChanged then ''
328 X-ReloadIfChanged=true
329 '' else if !def.restartIfChanged then ''
+8-21
nixos/modules/virtualisation/amazon-image.nix
···89with lib;
1011-let cfg = config.ec2; in
0000001213{
14 imports = [ ../profiles/headless.nix ./ec2-data.nix ./amazon-init.nix ];
···61 # Nix operations.
62 boot.initrd.postMountCommands =
63 ''
64- metaDir=$targetRoot/etc/ec2-metadata
65- mkdir -m 0755 -p "$metaDir"
66-67- echo "getting EC2 instance metadata..."
68-69- if ! [ -e "$metaDir/ami-manifest-path" ]; then
70- wget -q -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
71- fi
72-73- if ! [ -e "$metaDir/user-data" ]; then
74- wget -q -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
75- fi
76-77- if ! [ -e "$metaDir/hostname" ]; then
78- wget -q -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
79- fi
80-81- if ! [ -e "$metaDir/public-keys-0-openssh-key" ]; then
82- wget -q -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
83- fi
8485 diskNr=0
86 diskForUnionfs=
···8}
910# construct an executable file that wraps the actual executable
11-# makeWrapper EXECUTABLE ARGS
1213# ARGS:
14# --argv0 NAME : set name of executed process to NAME
···8}
910# construct an executable file that wraps the actual executable
11+# makeWrapper EXECUTABLE OUT_PATH ARGS
1213# ARGS:
14# --argv0 NAME : set name of executed process to NAME
+9-7
pkgs/build-support/trivial-builders.nix
···258 * Example:
259 *
260 * # Symlinks hello path in store to current $out/hello
261- * linkFarm "hello" entries = [ { name = "hello"; path = pkgs.hello; } ];
262 *
263 */
264- linkFarm = name: entries: runCommand name { preferLocalBuild = true; }
265- ("mkdir -p $out; cd $out; \n" +
266- (lib.concatMapStrings (x: ''
267- mkdir -p "$(dirname '${x.name}')"
268- ln -s '${x.path}' '${x.name}'
269- '') entries));
00270271272 /* Print an error message if the file with the specified name and
···258 * Example:
259 *
260 * # Symlinks hello path in store to current $out/hello
261+ * linkFarm "hello" [ { name = "hello"; path = pkgs.hello; } ];
262 *
263 */
264+ linkFarm = name: entries: runCommand name { preferLocalBuild = true; allowSubstitutes = false; }
265+ ''mkdir -p $out
266+ cd $out
267+ ${lib.concatMapStrings (x: ''
268+ mkdir -p "$(dirname ${lib.escapeShellArg x.name})"
269+ ln -s ${lib.escapeShellArg x.path} ${lib.escapeShellArg x.name}
270+ '') entries}
271+ '';
272273274 /* Print an error message if the file with the specified name and
···6}
78_trySourceRock() {
9-10 if ! [[ "$curSrc" =~ \.src.rock$ ]]; then return 1; fi
11-12- export PATH=${unzip}/bin:$PATH
1314 # luarocks expects a clean <name>.rock.spec name to be the package name
15 # so we have to strip the hash
···17 cp "$curSrc" "$renamed"
18 luarocks unpack --force "$renamed"
19}
20-
···6}
78_trySourceRock() {
09 if ! [[ "$curSrc" =~ \.src.rock$ ]]; then return 1; fi
001011 # luarocks expects a clean <name>.rock.spec name to be the package name
12 # so we have to strip the hash
···14 cp "$curSrc" "$renamed"
15 luarocks unpack --force "$renamed"
16}
0