···3535 ("generators.mkValueStringDefault: " +
3636 "${t} not supported: ${toPretty {} v}");
3737 in if isInt v then toString v
3838+ # convert derivations to store paths
3939+ else if lib.isDerivation v then toString v
3840 # we default to not quoting strings
3941 else if isString v then v
4042 # isString returns "1", which is not a good default
···169171 # converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
170172 gitFlattenAttrs = let
171173 recurse = path: value:
172172- if isAttrs value then
174174+ if isAttrs value && !lib.isDerivation value then
173175 lib.mapAttrsToList (name: value: recurse ([ name ] ++ path) value) value
174176 else if length path > 1 then {
175177 ${concatStringsSep "." (lib.reverseList (tail path))}.${head path} = value;
···927927 file</link> format.
928928 </para>
929929 </listitem>
930930+ <listitem>
931931+ <para>
932932+ The <literal>datadog-agent</literal>,
933933+ <literal>datadog-integrations-core</literal> and
934934+ <literal>datadog-process-agent</literal> packages were
935935+ upgraded from 6.11.2 to 7.30.2, git-2018-09-18 to 7.30.1 and
936936+ 6.11.1 to 7.30.2, respectively. As a result
937937+ <literal>services.datadog-agent</literal> has had breaking
938938+ changes to the configuration file. For details, see the
939939+ <link xlink:href="https://github.com/DataDog/datadog-agent/blob/main/CHANGELOG.rst">upstream
940940+ changelog</link>.
941941+ </para>
942942+ </listitem>
930943 </itemizedlist>
931944 </section>
932945 <section xml:id="sec-release-21.11-notable-changes">
+5
nixos/doc/manual/release-notes/rl-2111.section.md
···271271272272- 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.
273273274274+- The `datadog-agent`, `datadog-integrations-core` and `datadog-process-agent` packages
275275+ 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,
276276+ respectively. As a result `services.datadog-agent` has had breaking changes to the
277277+ configuration file. For details, see the [upstream changelog](https://github.com/DataDog/datadog-agent/blob/main/CHANGELOG.rst).
278278+274279## Other Notable Changes {#sec-release-21.11-notable-changes}
275280276281- 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.
···11+{ config, lib, pkgs, ... }:
22+33+with lib;
44+55+let
66+ cfg = config.services.crossfire-server;
77+ serverPort = 13327;
88+in {
99+ options.services.crossfire-server = {
1010+ enable = mkOption {
1111+ type = types.bool;
1212+ default = false;
1313+ description = ''
1414+ If enabled, the Crossfire game server will be started at boot.
1515+ '';
1616+ };
1717+1818+ package = mkOption {
1919+ type = types.package;
2020+ default = pkgs.crossfire-server;
2121+ defaultText = "pkgs.crossfire-server";
2222+ description = ''
2323+ The package to use for the Crossfire server (and map/arch data, if you
2424+ don't change dataDir).
2525+ '';
2626+ };
2727+2828+ dataDir = mkOption {
2929+ type = types.str;
3030+ default = "${cfg.package}/share/crossfire";
3131+ defaultText = "\${config.services.crossfire.package}/share/crossfire";
3232+ description = ''
3333+ Where to load readonly data from -- maps, archetypes, treasure tables,
3434+ and the like. If you plan to edit the data on the live server (rather
3535+ than overlaying the crossfire-maps and crossfire-arch packages and
3636+ nixos-rebuilding), point this somewhere read-write and copy the data
3737+ there before starting the server.
3838+ '';
3939+ };
4040+4141+ stateDir = mkOption {
4242+ type = types.str;
4343+ default = "/var/lib/crossfire";
4444+ description = ''
4545+ Where to store runtime data (save files, persistent items, etc).
4646+4747+ If left at the default, this will be automatically created on server
4848+ startup if it does not already exist. If changed, it is the admin's
4949+ responsibility to make sure that the directory exists and is writeable
5050+ by the `crossfire` user.
5151+ '';
5252+ };
5353+5454+ openFirewall = mkOption {
5555+ type = types.bool;
5656+ default = false;
5757+ description = ''
5858+ Whether to open ports in the firewall for the server.
5959+ '';
6060+ };
6161+6262+ configFiles = mkOption {
6363+ type = types.attrsOf types.str;
6464+ description = ''
6565+ Text to append to the corresponding configuration files. Note that the
6666+ files given in the example are *not* the complete set of files available
6767+ to customize; look in /etc/crossfire after enabling the server to see
6868+ the available files, and read the comments in each file for detailed
6969+ documentation on the format and what settings are available.
7070+7171+ Note that the motd, rules, and news files, if configured here, will
7272+ overwrite the example files that come with the server, rather than being
7373+ appended to them as the other configuration files are.
7474+ '';
7575+ example = literalExample ''
7676+ dm_file = '''
7777+ admin:secret_password:localhost
7878+ jane:xyzzy:*
7979+ ''';
8080+ ban_file = '''
8181+ # Bob is a jerk
8282+ bob@*
8383+ # So is everyone on 192.168.86.255/24
8484+ *@192.168.86.
8585+ ''';
8686+ metaserver2 = '''
8787+ metaserver2_notification on
8888+ localhostname crossfire.example.net
8989+ ''';
9090+ motd = "Welcome to CrossFire!";
9191+ news = "No news yet.";
9292+ rules = "Don't be a jerk.";
9393+ settings = '''
9494+ # be nicer to newbies and harsher to experienced players
9595+ balanced_stat_loss true
9696+ # don't let players pick up and use admin-created items
9797+ real_wiz false
9898+ ''';
9999+ '';
100100+ default = {};
101101+ };
102102+ };
103103+104104+ config = mkIf cfg.enable {
105105+ users.users.crossfire = {
106106+ description = "Crossfire server daemon user";
107107+ home = cfg.stateDir;
108108+ createHome = false;
109109+ isSystemUser = true;
110110+ group = "crossfire";
111111+ };
112112+ users.groups.crossfire = {};
113113+114114+ # Merge the cfg.configFiles setting with the default files shipped with
115115+ # Crossfire.
116116+ # For most files this consists of reading ${crossfire}/etc/crossfire/${name}
117117+ # and appending the user setting to it; the motd, news, and rules are handled
118118+ # specially, with user-provided values completely replacing the original.
119119+ environment.etc = lib.attrsets.mapAttrs'
120120+ (name: value: lib.attrsets.nameValuePair "crossfire/${name}" {
121121+ mode = "0644";
122122+ text =
123123+ (optionalString (!elem name ["motd" "news" "rules"])
124124+ (fileContents "${cfg.package}/etc/crossfire/${name}"))
125125+ + "\n${value}";
126126+ }) ({
127127+ ban_file = "";
128128+ dm_file = "";
129129+ exp_table = "";
130130+ forbid = "";
131131+ metaserver2 = "";
132132+ motd = (fileContents "${cfg.package}/etc/crossfire/motd");
133133+ news = (fileContents "${cfg.package}/etc/crossfire/news");
134134+ rules = (fileContents "${cfg.package}/etc/crossfire/rules");
135135+ settings = "";
136136+ stat_bonus = "";
137137+ } // cfg.configFiles);
138138+139139+ systemd.services.crossfire-server = {
140140+ description = "Crossfire Server Daemon";
141141+ wantedBy = [ "multi-user.target" ];
142142+ after = [ "network.target" ];
143143+144144+ serviceConfig = mkMerge [
145145+ {
146146+ ExecStart = "${cfg.package}/bin/crossfire-server -conf /etc/crossfire -local '${cfg.stateDir}' -data '${cfg.dataDir}'";
147147+ Restart = "always";
148148+ User = "crossfire";
149149+ Group = "crossfire";
150150+ WorkingDirectory = cfg.stateDir;
151151+ }
152152+ (mkIf (cfg.stateDir == "/var/lib/crossfire") {
153153+ StateDirectory = "crossfire";
154154+ })
155155+ ];
156156+157157+ # The crossfire server needs access to a bunch of files at runtime that
158158+ # are not created automatically at server startup; they're meant to be
159159+ # installed in $PREFIX/var/crossfire by `make install`. And those files
160160+ # need to be writeable, so we can't just point at the ones in the nix
161161+ # store. Instead we take the approach of copying them out of the store
162162+ # on first run. If `bookarch` already exists, we assume the rest of the
163163+ # files do as well, and copy nothing -- otherwise we risk ovewriting
164164+ # server state information every time the server is upgraded.
165165+ preStart = ''
166166+ if [ ! -e "${cfg.stateDir}"/bookarch ]; then
167167+ ${pkgs.rsync}/bin/rsync -a --chmod=u=rwX,go=rX \
168168+ "${cfg.package}/var/crossfire/" "${cfg.stateDir}/"
169169+ fi
170170+ '';
171171+ };
172172+173173+ networking.firewall = mkIf cfg.openFirewall {
174174+ allowedTCPPorts = [ serverPort ];
175175+ };
176176+ };
177177+}
+170
nixos/modules/services/games/deliantra-server.nix
···11+{ config, lib, pkgs, ... }:
22+33+with lib;
44+55+let
66+ cfg = config.services.deliantra-server;
77+ serverPort = 13327;
88+in {
99+ options.services.deliantra-server = {
1010+ enable = mkOption {
1111+ type = types.bool;
1212+ default = false;
1313+ description = ''
1414+ If enabled, the Deliantra game server will be started at boot.
1515+ '';
1616+ };
1717+1818+ package = mkOption {
1919+ type = types.package;
2020+ default = pkgs.deliantra-server;
2121+ defaultText = "pkgs.deliantra-server";
2222+ description = ''
2323+ The package to use for the Deliantra server (and map/arch data, if you
2424+ don't change dataDir).
2525+ '';
2626+ };
2727+2828+ dataDir = mkOption {
2929+ type = types.str;
3030+ default = "${pkgs.deliantra-data}";
3131+ defaultText = "\${pkgs.deliantra-data}";
3232+ description = ''
3333+ Where to store readonly data (maps, archetypes, sprites, etc).
3434+ Note that if you plan to use the live map editor (rather than editing
3535+ the maps offline and then nixos-rebuilding), THIS MUST BE WRITEABLE --
3636+ copy the deliantra-data someplace writeable (say,
3737+ /var/lib/deliantra/data) and update this option accordingly.
3838+ '';
3939+ };
4040+4141+ stateDir = mkOption {
4242+ type = types.str;
4343+ default = "/var/lib/deliantra";
4444+ description = ''
4545+ Where to store runtime data (save files, persistent items, etc).
4646+4747+ If left at the default, this will be automatically created on server
4848+ startup if it does not already exist. If changed, it is the admin's
4949+ responsibility to make sure that the directory exists and is writeable
5050+ by the `crossfire` user.
5151+ '';
5252+ };
5353+5454+ openFirewall = mkOption {
5555+ type = types.bool;
5656+ default = false;
5757+ description = ''
5858+ Whether to open ports in the firewall for the server.
5959+ '';
6060+ };
6161+6262+ configFiles = mkOption {
6363+ type = types.attrsOf types.str;
6464+ description = ''
6565+ Contents of the server configuration files. These will be appended to
6666+ the example configurations the server comes with and overwrite any
6767+ default settings defined therein.
6868+6969+ The example here is not comprehensive. See the files in
7070+ /etc/deliantra-server after enabling this module for full documentation.
7171+ '';
7272+ example = literalExample ''
7373+ dm_file = '''
7474+ admin:secret_password:localhost
7575+ jane:xyzzy:*
7676+ ''';
7777+ motd = "Welcome to Deliantra!";
7878+ settings = '''
7979+ # Settings for game mechanics.
8080+ stat_loss_on_death true
8181+ armor_max_enchant 7
8282+ ''';
8383+ config = '''
8484+ # Settings for the server daemon.
8585+ hiscore_url https://deliantra.example.net/scores/
8686+ max_map_reset 86400
8787+ ''';
8888+ '';
8989+ default = {
9090+ motd = "";
9191+ };
9292+ };
9393+ };
9494+9595+ config = mkIf cfg.enable {
9696+ users.users.deliantra = {
9797+ description = "Deliantra server daemon user";
9898+ home = cfg.stateDir;
9999+ createHome = false;
100100+ isSystemUser = true;
101101+ group = "deliantra";
102102+ };
103103+ users.groups.deliantra = {};
104104+105105+ # Merge the cfg.configFiles setting with the default files shipped with
106106+ # Deliantra.
107107+ # For most files this consists of reading
108108+ # ${deliantra}/etc/deliantra-server/${name} and appending the user setting
109109+ # to it.
110110+ environment.etc = lib.attrsets.mapAttrs'
111111+ (name: value: lib.attrsets.nameValuePair "deliantra-server/${name}" {
112112+ mode = "0644";
113113+ text =
114114+ # Deliantra doesn't come with a motd file, but respects it if present
115115+ # in /etc.
116116+ (optionalString (name != "motd")
117117+ (fileContents "${cfg.package}/etc/deliantra-server/${name}"))
118118+ + "\n${value}";
119119+ }) ({
120120+ motd = "";
121121+ settings = "";
122122+ config = "";
123123+ dm_file = "";
124124+ } // cfg.configFiles);
125125+126126+ systemd.services.deliantra-server = {
127127+ description = "Deliantra Server Daemon";
128128+ wantedBy = [ "multi-user.target" ];
129129+ after = [ "network.target" ];
130130+131131+ environment = {
132132+ DELIANTRA_DATADIR="${cfg.dataDir}";
133133+ DELIANTRA_LOCALDIR="${cfg.stateDir}";
134134+ DELIANTRA_CONFDIR="/etc/deliantra-server";
135135+ };
136136+137137+ serviceConfig = mkMerge [
138138+ {
139139+ ExecStart = "${cfg.package}/bin/deliantra-server";
140140+ Restart = "always";
141141+ User = "deliantra";
142142+ Group = "deliantra";
143143+ WorkingDirectory = cfg.stateDir;
144144+ }
145145+ (mkIf (cfg.stateDir == "/var/lib/deliantra") {
146146+ StateDirectory = "deliantra";
147147+ })
148148+ ];
149149+150150+ # The deliantra server needs access to a bunch of files at runtime that
151151+ # are not created automatically at server startup; they're meant to be
152152+ # installed in $PREFIX/var/deliantra-server by `make install`. And those
153153+ # files need to be writeable, so we can't just point at the ones in the
154154+ # nix store. Instead we take the approach of copying them out of the store
155155+ # on first run. If `bookarch` already exists, we assume the rest of the
156156+ # files do as well, and copy nothing -- otherwise we risk ovewriting
157157+ # server state information every time the server is upgraded.
158158+ preStart = ''
159159+ if [ ! -e "${cfg.stateDir}"/bookarch ]; then
160160+ ${pkgs.rsync}/bin/rsync -a --chmod=u=rwX,go=rX \
161161+ "${cfg.package}/var/deliantra-server/" "${cfg.stateDir}/"
162162+ fi
163163+ '';
164164+ };
165165+166166+ networking.firewall = mkIf cfg.openFirewall {
167167+ allowedTCPPorts = [ serverPort ];
168168+ };
169169+ };
170170+}
···11-diff --git a/telfhash/grouping.py b/telfhash/grouping.py
22-index c62f8d9..4ee9f0b 100644
33---- a/telfhash/grouping.py
44-+++ b/telfhash/grouping.py
55-@@ -32,10 +32,10 @@ import tlsh
66- def get_combination(telfhash_data):
77-88- #
99-- # TLSH hash is 70 characters long. if the telfhash is not 70
1010-+ # The new TLSH hash is 72 characters long. if the telfhash is not 72
1111- # characters in length, exclude from the list
1212- #
1313-- 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]
1414-+ 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]
1515-1616- #
1717- # get the combination of all the possible pairs of filenames
1818-diff --git a/telfhash/telfhash.py b/telfhash/telfhash.py
1919-index f2bbd25..c6e346c 100755
2020---- a/telfhash/telfhash.py
2121-+++ b/telfhash/telfhash.py
2222-@@ -132,7 +132,7 @@ def get_hash(symbols_list):
2323- symbol_string = ",".join(symbols_list)
2424- encoded_symbol_string = symbol_string.encode("ascii")
2525-2626-- return tlsh.forcehash(encoded_symbol_string).lower()
2727-+ return tlsh.forcehash(encoded_symbol_string)
2828-2929-3030- def elf_get_imagebase(elf):