Skip to content

Commit 421a9e6

Browse files
Merge master into staging-next
2 parents c93daf9 + 08a0d49 commit 421a9e6

File tree

41 files changed

+1342
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1342
-430
lines changed

nixos/doc/manual/from_md/release-notes/rl-2111.section.xml

+8
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,14 @@ Superuser created successfully.
11521152
<literal>coursier</literal>, you can create a shell alias.
11531153
</para>
11541154
</listitem>
1155+
<listitem>
1156+
<para>
1157+
The <literal>services.mosquitto</literal> module has been
1158+
rewritten to support multiple listeners and per-listener
1159+
configuration. Module configurations from previous releases
1160+
will no longer work and must be updated.
1161+
</para>
1162+
</listitem>
11551163
</itemizedlist>
11561164
</section>
11571165
<section xml:id="sec-release-21.11-notable-changes">

nixos/doc/manual/release-notes/rl-2111.section.md

+3
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ In addition to numerous new and upgraded packages, this release has the followin
355355

356356
- The `coursier` package's binary was renamed from `coursier` to `cs`. Completions which haven't worked for a while should now work with the renamed binary. To keep using `coursier`, you can create a shell alias.
357357

358+
- The `services.mosquitto` module has been rewritten to support multiple listeners and per-listener configuration.
359+
Module configurations from previous releases will no longer work and must be updated.
360+
358361
## Other Notable Changes {#sec-release-21.11-notable-changes}
359362

360363

nixos/modules/services/backup/borgbackup.nix

+35-8
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ let
4242
${cfg.postInit}
4343
fi
4444
'' + ''
45-
borg create $extraArgs \
46-
--compression ${cfg.compression} \
47-
--exclude-from ${mkExcludeFile cfg} \
48-
$extraCreateArgs \
49-
"::$archiveName$archiveSuffix" \
50-
${escapeShellArgs cfg.paths}
45+
(
46+
set -o pipefail
47+
${optionalString (cfg.dumpCommand != null) ''${escapeShellArg cfg.dumpCommand} | \''}
48+
borg create $extraArgs \
49+
--compression ${cfg.compression} \
50+
--exclude-from ${mkExcludeFile cfg} \
51+
$extraCreateArgs \
52+
"::$archiveName$archiveSuffix" \
53+
${if cfg.paths == null then "-" else escapeShellArgs cfg.paths}
54+
)
5155
'' + optionalString cfg.appendFailedSuffix ''
5256
borg rename $extraArgs \
5357
"::$archiveName$archiveSuffix" "$archiveName"
@@ -182,6 +186,14 @@ let
182186
+ " without at least one public key";
183187
};
184188

189+
mkSourceAssertions = name: cfg: {
190+
assertion = count isNull [ cfg.dumpCommand cfg.paths ] == 1;
191+
message = ''
192+
Exactly one of borgbackup.jobs.${name}.paths or borgbackup.jobs.${name}.dumpCommand
193+
must be set.
194+
'';
195+
};
196+
185197
mkRemovableDeviceAssertions = name: cfg: {
186198
assertion = !(isLocalPath cfg.repo) -> !cfg.removableDevice;
187199
message = ''
@@ -240,11 +252,25 @@ in {
240252
options = {
241253

242254
paths = mkOption {
243-
type = with types; coercedTo str lib.singleton (listOf str);
244-
description = "Path(s) to back up.";
255+
type = with types; nullOr (coercedTo str lib.singleton (listOf str));
256+
default = null;
257+
description = ''
258+
Path(s) to back up.
259+
Mutually exclusive with <option>dumpCommand</option>.
260+
'';
245261
example = "/home/user";
246262
};
247263

264+
dumpCommand = mkOption {
265+
type = with types; nullOr path;
266+
default = null;
267+
description = ''
268+
Backup the stdout of this program instead of filesystem paths.
269+
Mutually exclusive with <option>paths</option>.
270+
'';
271+
example = "/path/to/createZFSsend.sh";
272+
};
273+
248274
repo = mkOption {
249275
type = types.str;
250276
description = "Remote or local repository to back up to.";
@@ -657,6 +683,7 @@ in {
657683
assertions =
658684
mapAttrsToList mkPassAssertion jobs
659685
++ mapAttrsToList mkKeysAssertion repos
686+
++ mapAttrsToList mkSourceAssertions jobs
660687
++ mapAttrsToList mkRemovableDeviceAssertions jobs;
661688

662689
system.activationScripts = mapAttrs' mkActivationScript jobs;

0 commit comments

Comments
 (0)