···4848 scope = "Maintain Cinnamon desktop environment and applications made by the LinuxMint team.";
4949 };
50505151+ chia = {
5252+ members = [
5353+ atemu
5454+ lourkeur
5555+ ];
5656+ scope = "Maintain the Chia blockchain and its dependencies";
5757+ };
5858+5159 deshaw = {
5260 # Verify additions to this team with at least one already existing member of the team.
5361 members = [
+7
nixos/lib/build-vms.nix
···3636 [ ../modules/virtualisation/qemu-vm.nix
3737 ../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs
3838 { key = "no-manual"; documentation.nixos.enable = false; }
3939+ { key = "no-revision";
4040+ # Make the revision metadata constant, in order to avoid needless retesting.
4141+ # The human version (e.g. 21.05-pre) is left as is, because it is useful
4242+ # for external modules that test with e.g. nixosTest and rely on that
4343+ # version number.
4444+ config.system.nixos.revision = "constant-nixos-revision";
4545+ }
3946 { key = "nodes"; _module.args.nodes = nodes; }
4047 ] ++ optional minimal ../modules/testing/minimal-kernel.nix;
4148 };
···33with lib;
4455let
66-76 cfg = config.services.netatalk;
88-99- extmapFile = pkgs.writeText "extmap.conf" cfg.extmap;
1010-1111- afpToString = x: if builtins.typeOf x == "bool"
1212- then boolToString x
1313- else toString x;
1414-1515- volumeConfig = name:
1616- let vol = getAttr name cfg.volumes; in
1717- "[${name}]\n " + (toString (
1818- map
1919- (key: "${key} = ${afpToString (getAttr key vol)}\n")
2020- (attrNames vol)
2121- ));
2222-2323- afpConf = ''[Global]
2424- extmap file = ${extmapFile}
2525- afp port = ${toString cfg.port}
2626-2727- ${cfg.extraConfig}
2828-2929- ${if cfg.homes.enable then ''[Homes]
3030- ${optionalString (cfg.homes.path != "") "path = ${cfg.homes.path}"}
3131- basedir regex = ${cfg.homes.basedirRegex}
3232- ${cfg.homes.extraConfig}
3333- '' else ""}
3434-3535- ${toString (map volumeConfig (attrNames cfg.volumes))}
3636- '';
3737-3838- afpConfFile = pkgs.writeText "afp.conf" afpConf;
3939-4040-in
4141-4242-{
77+ settingsFormat = pkgs.formats.ini { };
88+ afpConfFile = settingsFormat.generate "afp.conf" cfg.settings;
99+in {
4310 options = {
4411 services.netatalk = {
4512···5118 description = "TCP port to be used for AFP.";
5219 };
53205454- extraConfig = mkOption {
5555- type = types.lines;
5656- default = "";
5757- example = "uam list = uams_guest.so";
2121+ settings = mkOption {
2222+ inherit (settingsFormat) type;
2323+ default = { };
2424+ example = {
2525+ Global = { "uam list" = "uams_guest.so"; };
2626+ Homes = {
2727+ path = "afp-data";
2828+ "basedir regex" = "/home";
2929+ };
3030+ example-volume = {
3131+ path = "/srv/volume";
3232+ "read only" = true;
3333+ };
3434+ };
5835 description = ''
5959- Lines of configuration to add to the <literal>[Global]</literal> section.
6060- See <literal>man apf.conf</literal> for more information.
6161- '';
6262- };
6363-6464- homes = {
6565- enable = mkOption {
6666- type = types.bool;
6767- default = false;
6868- description = "Enable sharing of the UNIX server user home directories.";
6969- };
7070-7171- path = mkOption {
7272- type = types.str;
7373- default = "";
7474- example = "afp-data";
7575- description = "Share not the whole user home but this subdirectory path.";
7676- };
7777-7878- basedirRegex = mkOption {
7979- example = "/home";
8080- type = types.str;
8181- description = "Regex which matches the parent directory of the user homes.";
8282- };
8383-8484- extraConfig = mkOption {
8585- type = types.lines;
8686- default = "";
8787- description = ''
8888- Lines of configuration to add to the <literal>[Homes]</literal> section.
8989- See <literal>man apf.conf</literal> for more information.
9090- '';
9191- };
9292- };
9393-9494- volumes = mkOption {
9595- default = { };
9696- type = types.attrsOf (types.attrsOf types.unspecified);
9797- description =
9898- ''
9999- Set of AFP volumes to export.
100100- See <literal>man apf.conf</literal> for more information.
101101- '';
102102- example = literalExample ''
103103- { srv =
104104- { path = "/srv";
105105- "read only" = true;
106106- "hosts allow" = "10.1.0.0/16 10.2.1.100 2001:0db8:1234::/48";
107107- };
108108- }
3636+ Configuration for Netatalk. See
3737+ <citerefentry><refentrytitle>afp.conf</refentrytitle>
3838+ <manvolnum>5</manvolnum></citerefentry>.
10939 '';
11040 };
11141···11444 default = "";
11545 description = ''
11646 File name extension mappings.
117117- See <literal>man extmap.conf</literal> for more information.
4747+ See <citerefentry><refentrytitle>extmap.conf</refentrytitle>
4848+ <manvolnum>5</manvolnum></citerefentry>. for more information.
11849 '';
11950 };
1205112152 };
12253 };
123545555+ imports = (map (option:
5656+ mkRemovedOptionModule [ "services" "netatalk" option ]
5757+ "This option was removed in favor of `services.netatalk.settings`.") [
5858+ "extraConfig"
5959+ "homes"
6060+ "volumes"
6161+ ]);
6262+12463 config = mkIf cfg.enable {
125646565+ services.netatalk.settings.Global = {
6666+ "afp port" = toString cfg.port;
6767+ "extmap file" = "${pkgs.writeText "extmap.conf" cfg.extmap}";
6868+ };
6969+12670 systemd.services.netatalk = {
12771 description = "Netatalk AFP fileserver for Macintosh clients";
128128- unitConfig.Documentation = "man:afp.conf(5) man:netatalk(8) man:afpd(8) man:cnid_metad(8) man:cnid_dbd(8)";
7272+ unitConfig.Documentation =
7373+ "man:afp.conf(5) man:netatalk(8) man:afpd(8) man:cnid_metad(8) man:cnid_dbd(8)";
12974 after = [ "network.target" "avahi-daemon.service" ];
13075 wantedBy = [ "multi-user.target" ];
13176···13580 Type = "forking";
13681 GuessMainPID = "no";
13782 PIDFile = "/run/lock/netatalk";
138138- ExecStartPre = "${pkgs.coreutils}/bin/mkdir -m 0755 -p /var/lib/netatalk/CNID";
139139- ExecStart = "${pkgs.netatalk}/sbin/netatalk -F ${afpConfFile}";
8383+ ExecStart = "${pkgs.netatalk}/sbin/netatalk -F ${afpConfFile}";
14084 ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
141141- ExecStop = "${pkgs.coreutils}/bin/kill -TERM $MAINPID";
8585+ ExecStop = "${pkgs.coreutils}/bin/kill -TERM $MAINPID";
14286 Restart = "always";
14387 RestartSec = 1;
8888+ StateDirectory = [ "netatalk/CNID" ];
14489 };
1459014691 };
+19-3
nixos/modules/services/networking/nsd.nix
···20202121 mkZoneFileName = name: if name == "." then "root" else name;
22222323+ # replaces include: directives for keys with fake keys for nsd-checkconf
2424+ injectFakeKeys = keys: concatStrings
2525+ (mapAttrsToList
2626+ (keyName: keyOptions: ''
2727+ fakeKey="$(${pkgs.bind}/bin/tsig-keygen -a ${escapeShellArgs [ keyOptions.algorithm keyName ]} | grep -oP "\s*secret \"\K.*(?=\";)")"
2828+ sed "s@^\s*include:\s*\"${stateDir}/private/${keyName}\"\$@secret: $fakeKey@" -i $out/nsd.conf
2929+ '')
3030+ keys);
3131+2332 nsdEnv = pkgs.buildEnv {
2433 name = "nsd-env";
2534···3443 echo "|- checking zone '$out/zones/$zoneFile'"
3544 ${nsdPkg}/sbin/nsd-checkzone "$zoneFile" "$zoneFile" || {
3645 if grep -q \\\\\\$ "$zoneFile"; then
3737- echo zone "$zoneFile" contains escaped dollar signes \\\$
3838- echo Escaping them is not needed any more. Please make shure \
3939- to unescape them where they prefix a variable name
4646+ echo zone "$zoneFile" contains escaped dollar signs \\\$
4747+ echo Escaping them is not needed any more. Please make sure \
4848+ to unescape them where they prefix a variable name.
4049 fi
41504251 exit 1
···4453 done
45544655 echo "checking configuration file"
5656+ # Save original config file including key references...
5757+ cp $out/nsd.conf{,.orig}
5858+ # ...inject mock keys into config
5959+ ${injectFakeKeys cfg.keys}
6060+ # ...do the checkconf
4761 ${nsdPkg}/sbin/nsd-checkconf $out/nsd.conf
6262+ # ... and restore original config file.
6363+ mv $out/nsd.conf{.orig,}
4864 '';
4965 };
5066
···11-#!/usr/bin/env bash
22-33-###
44-### This script runs 'nix-build' with ./fetch-source.nix and copies a subset
55-### of the resulting store path into the current working directory.
66-###
77-### To disable running chmod, you may set the environment
88-### variable "FIX_RIGHTS" to "no".
99-###
1010-1111-set -euo pipefail
1212-1313-# 'nix-build' command
1414-NIX_BUILD_BIN="${NIX_BUILD_BIN:-"/usr/bin/env nix-build"}"
1515-1616-# where to place the yarn2nix source
1717-TARGET_DIR="${TARGET_DIR:-"./yarn2nix"}"
1818-1919-# whether to run 'chmod -R u=rwX,g=rX,o-rwx' on copied files in $TARGET_DIR
2020-FIX_RIGHTS="${FIX_RIGHTS:-"yes"}"
2121-2222-fetch_git_source() {
2323- [[ -f ./fetch-source.nix ]] && ret="$($NIX_BUILD_BIN --no-out-link ./fetch-source.nix)" && ec="$?" || ec="$?"
2424- if [[ "$ec" == "0" ]]; then
2525- echo "$ret"
2626- else
2727- printf "error: failed at 'fetch_git_source()' with '%s'" "$ret"
2828- fi
2929-}
3030-3131-result="$(fetch_git_source)"
3232-if [[ "$result" == "/nix/store"* ]]; then
3333- mkdir -p "$TARGET_DIR"
3434- cp -Rv \
3535- "${result}/"{bin,internal,lib,nix,default.nix,package.json,yarn.nix,yarn.lock,LICENSE.txt} \
3636- "$TARGET_DIR"
3737- [[ "$FIX_RIGHTS" = "yes" ]] \
3838- && chmod -v "u=rwX,g=rX,o-rwx" -R \
3939- "$TARGET_DIR/"{bin,internal,lib,nix,default.nix,package.json,yarn.nix,yarn.lock,LICENSE.txt}
4040-fi
···2222 }
23232424 return url
2525- .replace('https://registry.yarnpkg.com/', '') // prevents having long directory names
2626- .replace(/[@/:-]/g, '_') // replace @ and : and - characters with underscore
2525+ .replace(/https:\/\/(.)*(.com)\//g, '') // prevents having long directory names
2626+ .replace(/[@/%:-]/g, '_') // replace @ and : and - and % characters with underscore
2727}
28282929module.exports = urlToName
···642642 rdiff_backup = rdiff-backup; # added 2014-11-23
643643 rdmd = dtools; # added 2017-08-19
644644 readline80 = throw "readline-8.0 is no longer supported in nixpkgs, please use 'readline' for main supported version or 'readline81' for most recent version"; # added 2021-04-22
645645+ retroshare = throw "retroshare was removed because it was broken"; # added 2021-05-17
645646 rhc = throw "rhc was deprecated on 2019-04-09: abandoned by upstream.";
646647 rng_tools = rng-tools; # added 2018-10-24
647648 robomongo = robo3t; #added 2017-09-28