···35 ("generators.mkValueStringDefault: " +
36 "${t} not supported: ${toPretty {} v}");
37 in if isInt v then toString v
0038 # we default to not quoting strings
39 else if isString v then v
40 # isString returns "1", which is not a good default
···169 # converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
170 gitFlattenAttrs = let
171 recurse = path: value:
172- if isAttrs value then
173 lib.mapAttrsToList (name: value: recurse ([ name ] ++ path) value) value
174 else if length path > 1 then {
175 ${concatStringsSep "." (lib.reverseList (tail path))}.${head path} = value;
···35 ("generators.mkValueStringDefault: " +
36 "${t} not supported: ${toPretty {} v}");
37 in if isInt v then toString v
38+ # convert derivations to store paths
39+ else if lib.isDerivation v then toString v
40 # we default to not quoting strings
41 else if isString v then v
42 # isString returns "1", which is not a good default
···171 # converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
172 gitFlattenAttrs = let
173 recurse = path: value:
174+ if isAttrs value && !lib.isDerivation value then
175 lib.mapAttrsToList (name: value: recurse ([ name ] ++ path) value) value
176 else if length path > 1 then {
177 ${concatStringsSep "." (lib.reverseList (tail path))}.${head path} = value;
···927 file</link> format.
928 </para>
929 </listitem>
930+ <listitem>
931+ <para>
932+ The <literal>datadog-agent</literal>,
933+ <literal>datadog-integrations-core</literal> and
934+ <literal>datadog-process-agent</literal> packages were
935+ upgraded from 6.11.2 to 7.30.2, git-2018-09-18 to 7.30.1 and
936+ 6.11.1 to 7.30.2, respectively. As a result
937+ <literal>services.datadog-agent</literal> has had breaking
938+ changes to the configuration file. For details, see the
939+ <link xlink:href="https://github.com/DataDog/datadog-agent/blob/main/CHANGELOG.rst">upstream
940+ changelog</link>.
941+ </para>
942+ </listitem>
943 </itemizedlist>
944 </section>
945 <section xml:id="sec-release-21.11-notable-changes">
+5
nixos/doc/manual/release-notes/rl-2111.section.md
···271272- The `todoman` package was upgraded from 3.9.0 to 4.0.0. This introduces breaking changes in the [configuration file](https://todoman.readthedocs.io/en/stable/configure.html#configuration-file) format.
27300000274## Other Notable Changes {#sec-release-21.11-notable-changes}
275276- The linux kernel package infrastructure was moved out of `all-packages.nix`, and restructured. Linux related functions and attributes now live under the `pkgs.linuxKernel` attribute set.
···271272- The `todoman` package was upgraded from 3.9.0 to 4.0.0. This introduces breaking changes in the [configuration file](https://todoman.readthedocs.io/en/stable/configure.html#configuration-file) format.
273274+- The `datadog-agent`, `datadog-integrations-core` and `datadog-process-agent` packages
275+ were upgraded from 6.11.2 to 7.30.2, git-2018-09-18 to 7.30.1 and 6.11.1 to 7.30.2,
276+ respectively. As a result `services.datadog-agent` has had breaking changes to the
277+ configuration file. For details, see the [upstream changelog](https://github.com/DataDog/datadog-agent/blob/main/CHANGELOG.rst).
278+279## Other Notable Changes {#sec-release-21.11-notable-changes}
280281- The linux kernel package infrastructure was moved out of `all-packages.nix`, and restructured. Linux related functions and attributes now live under the `pkgs.linuxKernel` attribute set.
···1+{ config, lib, pkgs, ... }:
2+3+with lib;
4+5+let
6+ cfg = config.services.crossfire-server;
7+ serverPort = 13327;
8+in {
9+ options.services.crossfire-server = {
10+ enable = mkOption {
11+ type = types.bool;
12+ default = false;
13+ description = ''
14+ If enabled, the Crossfire game server will be started at boot.
15+ '';
16+ };
17+18+ package = mkOption {
19+ type = types.package;
20+ default = pkgs.crossfire-server;
21+ defaultText = "pkgs.crossfire-server";
22+ description = ''
23+ The package to use for the Crossfire server (and map/arch data, if you
24+ don't change dataDir).
25+ '';
26+ };
27+28+ dataDir = mkOption {
29+ type = types.str;
30+ default = "${cfg.package}/share/crossfire";
31+ defaultText = "\${config.services.crossfire.package}/share/crossfire";
32+ description = ''
33+ Where to load readonly data from -- maps, archetypes, treasure tables,
34+ and the like. If you plan to edit the data on the live server (rather
35+ than overlaying the crossfire-maps and crossfire-arch packages and
36+ nixos-rebuilding), point this somewhere read-write and copy the data
37+ there before starting the server.
38+ '';
39+ };
40+41+ stateDir = mkOption {
42+ type = types.str;
43+ default = "/var/lib/crossfire";
44+ description = ''
45+ Where to store runtime data (save files, persistent items, etc).
46+47+ If left at the default, this will be automatically created on server
48+ startup if it does not already exist. If changed, it is the admin's
49+ responsibility to make sure that the directory exists and is writeable
50+ by the `crossfire` user.
51+ '';
52+ };
53+54+ openFirewall = mkOption {
55+ type = types.bool;
56+ default = false;
57+ description = ''
58+ Whether to open ports in the firewall for the server.
59+ '';
60+ };
61+62+ configFiles = mkOption {
63+ type = types.attrsOf types.str;
64+ description = ''
65+ Text to append to the corresponding configuration files. Note that the
66+ files given in the example are *not* the complete set of files available
67+ to customize; look in /etc/crossfire after enabling the server to see
68+ the available files, and read the comments in each file for detailed
69+ documentation on the format and what settings are available.
70+71+ Note that the motd, rules, and news files, if configured here, will
72+ overwrite the example files that come with the server, rather than being
73+ appended to them as the other configuration files are.
74+ '';
75+ example = literalExample ''
76+ dm_file = '''
77+ admin:secret_password:localhost
78+ jane:xyzzy:*
79+ ''';
80+ ban_file = '''
81+ # Bob is a jerk
82+ bob@*
83+ # So is everyone on 192.168.86.255/24
84+ *@192.168.86.
85+ ''';
86+ metaserver2 = '''
87+ metaserver2_notification on
88+ localhostname crossfire.example.net
89+ ''';
90+ motd = "Welcome to CrossFire!";
91+ news = "No news yet.";
92+ rules = "Don't be a jerk.";
93+ settings = '''
94+ # be nicer to newbies and harsher to experienced players
95+ balanced_stat_loss true
96+ # don't let players pick up and use admin-created items
97+ real_wiz false
98+ ''';
99+ '';
100+ default = {};
101+ };
102+ };
103+104+ config = mkIf cfg.enable {
105+ users.users.crossfire = {
106+ description = "Crossfire server daemon user";
107+ home = cfg.stateDir;
108+ createHome = false;
109+ isSystemUser = true;
110+ group = "crossfire";
111+ };
112+ users.groups.crossfire = {};
113+114+ # Merge the cfg.configFiles setting with the default files shipped with
115+ # Crossfire.
116+ # For most files this consists of reading ${crossfire}/etc/crossfire/${name}
117+ # and appending the user setting to it; the motd, news, and rules are handled
118+ # specially, with user-provided values completely replacing the original.
119+ environment.etc = lib.attrsets.mapAttrs'
120+ (name: value: lib.attrsets.nameValuePair "crossfire/${name}" {
121+ mode = "0644";
122+ text =
123+ (optionalString (!elem name ["motd" "news" "rules"])
124+ (fileContents "${cfg.package}/etc/crossfire/${name}"))
125+ + "\n${value}";
126+ }) ({
127+ ban_file = "";
128+ dm_file = "";
129+ exp_table = "";
130+ forbid = "";
131+ metaserver2 = "";
132+ motd = (fileContents "${cfg.package}/etc/crossfire/motd");
133+ news = (fileContents "${cfg.package}/etc/crossfire/news");
134+ rules = (fileContents "${cfg.package}/etc/crossfire/rules");
135+ settings = "";
136+ stat_bonus = "";
137+ } // cfg.configFiles);
138+139+ systemd.services.crossfire-server = {
140+ description = "Crossfire Server Daemon";
141+ wantedBy = [ "multi-user.target" ];
142+ after = [ "network.target" ];
143+144+ serviceConfig = mkMerge [
145+ {
146+ ExecStart = "${cfg.package}/bin/crossfire-server -conf /etc/crossfire -local '${cfg.stateDir}' -data '${cfg.dataDir}'";
147+ Restart = "always";
148+ User = "crossfire";
149+ Group = "crossfire";
150+ WorkingDirectory = cfg.stateDir;
151+ }
152+ (mkIf (cfg.stateDir == "/var/lib/crossfire") {
153+ StateDirectory = "crossfire";
154+ })
155+ ];
156+157+ # The crossfire server needs access to a bunch of files at runtime that
158+ # are not created automatically at server startup; they're meant to be
159+ # installed in $PREFIX/var/crossfire by `make install`. And those files
160+ # need to be writeable, so we can't just point at the ones in the nix
161+ # store. Instead we take the approach of copying them out of the store
162+ # on first run. If `bookarch` already exists, we assume the rest of the
163+ # files do as well, and copy nothing -- otherwise we risk ovewriting
164+ # server state information every time the server is upgraded.
165+ preStart = ''
166+ if [ ! -e "${cfg.stateDir}"/bookarch ]; then
167+ ${pkgs.rsync}/bin/rsync -a --chmod=u=rwX,go=rX \
168+ "${cfg.package}/var/crossfire/" "${cfg.stateDir}/"
169+ fi
170+ '';
171+ };
172+173+ networking.firewall = mkIf cfg.openFirewall {
174+ allowedTCPPorts = [ serverPort ];
175+ };
176+ };
177+}
···1+{ config, lib, pkgs, ... }:
2+3+with lib;
4+5+let
6+ cfg = config.services.deliantra-server;
7+ serverPort = 13327;
8+in {
9+ options.services.deliantra-server = {
10+ enable = mkOption {
11+ type = types.bool;
12+ default = false;
13+ description = ''
14+ If enabled, the Deliantra game server will be started at boot.
15+ '';
16+ };
17+18+ package = mkOption {
19+ type = types.package;
20+ default = pkgs.deliantra-server;
21+ defaultText = "pkgs.deliantra-server";
22+ description = ''
23+ The package to use for the Deliantra server (and map/arch data, if you
24+ don't change dataDir).
25+ '';
26+ };
27+28+ dataDir = mkOption {
29+ type = types.str;
30+ default = "${pkgs.deliantra-data}";
31+ defaultText = "\${pkgs.deliantra-data}";
32+ description = ''
33+ Where to store readonly data (maps, archetypes, sprites, etc).
34+ Note that if you plan to use the live map editor (rather than editing
35+ the maps offline and then nixos-rebuilding), THIS MUST BE WRITEABLE --
36+ copy the deliantra-data someplace writeable (say,
37+ /var/lib/deliantra/data) and update this option accordingly.
38+ '';
39+ };
40+41+ stateDir = mkOption {
42+ type = types.str;
43+ default = "/var/lib/deliantra";
44+ description = ''
45+ Where to store runtime data (save files, persistent items, etc).
46+47+ If left at the default, this will be automatically created on server
48+ startup if it does not already exist. If changed, it is the admin's
49+ responsibility to make sure that the directory exists and is writeable
50+ by the `crossfire` user.
51+ '';
52+ };
53+54+ openFirewall = mkOption {
55+ type = types.bool;
56+ default = false;
57+ description = ''
58+ Whether to open ports in the firewall for the server.
59+ '';
60+ };
61+62+ configFiles = mkOption {
63+ type = types.attrsOf types.str;
64+ description = ''
65+ Contents of the server configuration files. These will be appended to
66+ the example configurations the server comes with and overwrite any
67+ default settings defined therein.
68+69+ The example here is not comprehensive. See the files in
70+ /etc/deliantra-server after enabling this module for full documentation.
71+ '';
72+ example = literalExample ''
73+ dm_file = '''
74+ admin:secret_password:localhost
75+ jane:xyzzy:*
76+ ''';
77+ motd = "Welcome to Deliantra!";
78+ settings = '''
79+ # Settings for game mechanics.
80+ stat_loss_on_death true
81+ armor_max_enchant 7
82+ ''';
83+ config = '''
84+ # Settings for the server daemon.
85+ hiscore_url https://deliantra.example.net/scores/
86+ max_map_reset 86400
87+ ''';
88+ '';
89+ default = {
90+ motd = "";
91+ };
92+ };
93+ };
94+95+ config = mkIf cfg.enable {
96+ users.users.deliantra = {
97+ description = "Deliantra server daemon user";
98+ home = cfg.stateDir;
99+ createHome = false;
100+ isSystemUser = true;
101+ group = "deliantra";
102+ };
103+ users.groups.deliantra = {};
104+105+ # Merge the cfg.configFiles setting with the default files shipped with
106+ # Deliantra.
107+ # For most files this consists of reading
108+ # ${deliantra}/etc/deliantra-server/${name} and appending the user setting
109+ # to it.
110+ environment.etc = lib.attrsets.mapAttrs'
111+ (name: value: lib.attrsets.nameValuePair "deliantra-server/${name}" {
112+ mode = "0644";
113+ text =
114+ # Deliantra doesn't come with a motd file, but respects it if present
115+ # in /etc.
116+ (optionalString (name != "motd")
117+ (fileContents "${cfg.package}/etc/deliantra-server/${name}"))
118+ + "\n${value}";
119+ }) ({
120+ motd = "";
121+ settings = "";
122+ config = "";
123+ dm_file = "";
124+ } // cfg.configFiles);
125+126+ systemd.services.deliantra-server = {
127+ description = "Deliantra Server Daemon";
128+ wantedBy = [ "multi-user.target" ];
129+ after = [ "network.target" ];
130+131+ environment = {
132+ DELIANTRA_DATADIR="${cfg.dataDir}";
133+ DELIANTRA_LOCALDIR="${cfg.stateDir}";
134+ DELIANTRA_CONFDIR="/etc/deliantra-server";
135+ };
136+137+ serviceConfig = mkMerge [
138+ {
139+ ExecStart = "${cfg.package}/bin/deliantra-server";
140+ Restart = "always";
141+ User = "deliantra";
142+ Group = "deliantra";
143+ WorkingDirectory = cfg.stateDir;
144+ }
145+ (mkIf (cfg.stateDir == "/var/lib/deliantra") {
146+ StateDirectory = "deliantra";
147+ })
148+ ];
149+150+ # The deliantra server needs access to a bunch of files at runtime that
151+ # are not created automatically at server startup; they're meant to be
152+ # installed in $PREFIX/var/deliantra-server by `make install`. And those
153+ # files need to be writeable, so we can't just point at the ones in the
154+ # nix store. Instead we take the approach of copying them out of the store
155+ # on first run. If `bookarch` already exists, we assume the rest of the
156+ # files do as well, and copy nothing -- otherwise we risk ovewriting
157+ # server state information every time the server is upgraded.
158+ preStart = ''
159+ if [ ! -e "${cfg.stateDir}"/bookarch ]; then
160+ ${pkgs.rsync}/bin/rsync -a --chmod=u=rwX,go=rX \
161+ "${cfg.package}/var/deliantra-server/" "${cfg.stateDir}/"
162+ fi
163+ '';
164+ };
165+166+ networking.firewall = mkIf cfg.openFirewall {
167+ allowedTCPPorts = [ serverPort ];
168+ };
169+ };
170+}
···1-diff --git a/telfhash/grouping.py b/telfhash/grouping.py
2-index c62f8d9..4ee9f0b 100644
3---- a/telfhash/grouping.py
4-+++ b/telfhash/grouping.py
5-@@ -32,10 +32,10 @@ import tlsh
6- def get_combination(telfhash_data):
7-8- #
9-- # TLSH hash is 70 characters long. if the telfhash is not 70
10-+ # The new TLSH hash is 72 characters long. if the telfhash is not 72
11- # characters in length, exclude from the list
12- #
13-- files_list = [x for x in list(telfhash_data.keys()) if telfhash_data[x]["telfhash"] is not None and len(telfhash_data[x]["telfhash"]) == 70]
14-+ files_list = [x for x in list(telfhash_data.keys()) if telfhash_data[x]["telfhash"] is not None and len(telfhash_data[x]["telfhash"]) == 72]
15-16- #
17- # get the combination of all the possible pairs of filenames
18-diff --git a/telfhash/telfhash.py b/telfhash/telfhash.py
19-index f2bbd25..c6e346c 100755
20---- a/telfhash/telfhash.py
21-+++ b/telfhash/telfhash.py
22-@@ -132,7 +132,7 @@ def get_hash(symbols_list):
23- symbol_string = ",".join(symbols_list)
24- encoded_symbol_string = symbol_string.encode("ascii")
25-26-- return tlsh.forcehash(encoded_symbol_string).lower()
27-+ return tlsh.forcehash(encoded_symbol_string)
28-29-30- def elf_get_imagebase(elf):