Commit Graph

371 Commits

Author SHA1 Message Date
Shadaj Laddad
dd34f474ed nixos/restic: make it possible to use the existing backup cache for prune/check
Configures the `--cache-dir` parameter for the prune and check commands run after backing up. For `check`, also adds a `checkOpts` flag to enable using the cache, since that is disabled by default.
2022-10-12 09:09:27 -07:00
Artturin
6910a4eea0 treewide: makeWrapper to nativeBuildInputs
this should be all of them other than the failed splices
found with nixpkgs-lint
2022-09-26 17:53:26 +03:00
pennae
1d41cff3dc nixos/*: convert straggler options to MD 2022-08-31 17:27:38 +02:00
pennae
f2ea09ecbe nixos/*: convert options with listings
minor rendering changes.
2022-08-31 17:27:36 +02:00
pennae
722b99bc0e nixos/*: convert options with admonitions to MD
rendering changes only slightly, most changes are in spacing.
2022-08-31 16:36:16 +02:00
pennae
515c4727fa nixos/*: md-"convert" empty descriptions
for some reason these are not picked up properly by nix-doc-munge, so
we'll do this instead.
2022-08-31 16:32:54 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
1013069f52 nixos/*: convert more partially-md option descriptions
this mostly means marking options that use markdown already
appropriately and making a few adjustments so they still render
correctly. notable for nftables we have to transform the md links
because the manpage would not render them correctly otherwise.
2022-08-31 16:32:14 +02:00
Julien Moutinho
9a94509089 nixos/sanoid: fix aliased options
Fixes https://github.com/NixOS/nixpkgs/issues/181561
2022-08-22 18:56:47 +02:00
Jörg Thalheim
2c3f6055fb syncoid: handle syncing dataset without a parent 2022-08-16 06:18:54 +02:00
Sebastián Mancilla
10a745eac8
Merge pull request #179896 from erikarvstedt/fix-bash-exit-handler
treewide: fix bash exit handlers
2022-08-14 21:42:41 -04:00
pennae
50f9b3107a
Merge pull request #185474 from pennae/option-docs-md
nixos/*: more options md conversion
2022-08-12 23:23:26 +02:00
Thiago Kenji Okada
35348fcc07
Merge pull request #182831 from otavio/topic/use-postStop-for-restic
nixos/restic: use postStop for `backupCleanupCommand`
2022-08-09 18:39:42 +01:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
pennae
423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae
61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +02:00
pennae
3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +02:00
pennae
9c8531c8a5 nixos/*: replace <replaceable>s with «thing»
we can't embed syntactic annotations of this kind in markdown code
blocks without yet another extension. replaceable is rare enough to make
this not much worth it, so we'll go with «thing» instead. the module
system already uses this format for its placeholder names in attrsOf
paths.
2022-08-03 21:08:58 +02:00
pennae
6b13dd0e9e
Merge pull request #183491 from pennae/automatic-md-conversions
treewide: automatically md-convert option descriptions
2022-08-02 02:15:30 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Alan Strohm
81cd3e229c
nixos/restic: add 'backups.package' option to override the restic package (#183028) 2022-07-27 13:47:41 -04:00
Otavio Salvador
7e8e00d656 nixos/restic: use postStop for backupCleanupCommand
That way the `backupCleanupCommand` can also run when the backup service
failed for some reason.

Fixes: #182089.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2022-07-25 11:53:01 -03:00
Sandro Jäckel
af66b47b3a nixos/postgresql-backup: allow setting compression level 2022-07-11 21:28:22 +02:00
Shawn8901
98ac43a1cf
zrepl: add package option to module (#179189)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-10 20:32:27 +02:00
Erik Arvstedt
3f54dfa475
treewide: fix bash exit handlers
Transform exit handlers of the form
trap cleanup EXIT [INT] [TERM] [QUIT] [HUP] [ERR]
  (where cleanup is idempotent)
to
trap cleanup EXIT

This fixes a common bash antipattern.

Each of the above signals causes the script to exit. For each signal,
bash first handles the signal by running `cleanup` and then runs
`cleanup` again when handling EXIT.
(Exception:  `vscode/*` prevents the second run of `cleanup` by removing
the trap in cleanup`).

Simplify the cleanup logic by just trapping exit, which is always run
when the script exits due to any of the above signals.

Note: In case of borgbackup, the exit handler is not idempotent, but just
trapping EXIT guarantees that it's only run once.
2022-07-02 16:13:12 +02:00
Otavio Salvador
d9e3b1fafe nixos/restic: add backup{Prepare,Cleanup}Command options
The backupPrepareCommand and backupCleanupCommand options offer a way to
run a script to prepare for backup and then cleanup it once finish.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2022-06-03 11:22:22 -03:00
Otavio Salvador
deae887c5a nixos/restic: add new repositoryFile option
Allow providing the repository as a file, useful when we don't want it
being stored in the Git repository as plain text.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2022-06-03 11:21:37 -03:00
Otavio Salvador
082a4184ec nixos/restic: reformat
Apply nixpkgs-fmt on file prior doing changes.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2022-06-02 16:48:43 -03:00
Guillaume Girol
4f709ea817
Merge pull request #164883 from oxalica/feat/btrbk-no-timer
nixos/btrbk: allow instances without timers and simplify
2022-05-21 20:04:54 +00:00
Daniel Poelzleithner
64878e3a67 automysqlbackp: fix missing permissions for mysqldump
automysqldump passes the --events flag, but without the EVENTS permission a error occures:
> mysqldump: Couldn't execute 'show events': Access denied for user 'automysqlbackup'@'localhost' to database 'mysql' (1044)
2022-05-12 13:17:14 +02:00
oxalica
085a5256c1
nixos/btrbk: inherit lib functions to simplify use-sites 2022-05-12 05:55:39 +08:00
oxalica
60e13131b6
nixos/btrbk: allow instances without timers
This allows btrbk instances without a triggering timer by setting
`onCalendar` to `null`.
This is useful for manual-starting only btrbk backup settings.
2022-05-12 05:55:17 +08:00
Robert Schütz
2ddfd7e81b nixos/borgmatic: use pkgs.formats.yaml 2022-05-08 01:08:28 -07:00
Matt Layher
bb22a2debc nixos/zrepl: note about systemd unit, add snapshot test
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2022-03-30 08:55:15 -07:00
Vlastimil Holer
09a6ce91d8
nixos/mysqlBackup: set service Type
fixes #158802

Sets the mysql backup systemd service type to "oneshot" to ensure the
service is marked as started after the backup script fully proceeds. This
allows to reliably depend on completing of this service by other services.
2022-02-18 18:35:55 +01:00
Naïm Favier
6565458f9d
nixos/borgbackup: remove literalDocBook in description 2022-01-20 20:10:26 +01:00
Sandro
5c4fa6964f
Merge pull request #138386 from Yarny0/tsm-client 2022-01-18 20:50:28 +01:00
Felix Buehler
7caa6f4de4 nixos/borgbackup: move systemd.timers logic into single block 2022-01-18 12:53:36 +01:00
Felix Buehler
91dfaa5453 nixos/borgbackup: start remote backup only if network is available 2022-01-17 15:42:39 +01:00
blargg
697198834c nixos/borgbackup: Add a persistentTimer option.
Persistent starts the backup service on power on if it was missed while
the system was powered down, for example.
2022-01-17 15:42:37 +01:00
Yarny0
c2192ed77a nixos/tsm-{client,backup}: use new type nonEmptyStr
The module option type `nonEmptyStr` was introduced in commit

a3c5f0cba8

The tsm modules previously simply used
`strMatching ".+"` to prevent empty option strings,
but the new type is more thorough as
it also catches space-only strings.
2022-01-17 12:09:27 +01:00
Yarny0
c5effcaaea nixos/tsm-backup: enable most systemd sandboxing options
This enables some systemd sandboxing
options for the `tsm-backup.service`.
Those settings have been determined by expermentation.
This commit tries hard to protect the filesystem from
write access, but not to hide anything from read access,
so users can backup all files they choose to backup.
An exception are API filesystems (`/dev`, `/proc`, `/sys`):
As their "files" are not stored on persistent storage,
they are sandboxed away as much as possible.

Note that the service still has to run with root
privileges to reach files with limited access permissions.
The obvious alternative to use a dedicated user account and
the `CAP_DAC_READ_SEARCH` capability to permit system-wide
read access while blocking write access does not work.
Experiments have shown that `dsmc` verifies access permissions
for each file before attempting to open it for reading.
Hence `dsmc` refuses to copy files where the file permission
mode blocks read access -- even if process capabilities
would allow it to proceed irrespective of permissions.
2022-01-17 12:09:27 +01:00
Yarny0
3f6d1f5f60 nixos/tsm-{client,backup}: update links in module comments
IBM has changed the URL structures of their support web pages.
The commit at hand updates URLs in two comments
so they follow the new structure.
2022-01-17 12:09:27 +01:00
Winter
2104608642 nixos/borgbackup: allow empty archive base name 2022-01-16 10:41:04 -05:00
Robert Hensing
70d27303da
Merge pull request #149532 from pennae/split-docs-build
nixos/*: split docs build
2022-01-04 22:33:23 +01:00
Aneesh Agrawal
8729e8e261 nixos/restic-rest-server: Autocreate empty .htpasswd if needed for service boot
When `privateRepos = true`, the service will not start if the `.htpasswd` does not exist.
Use `systemd-tmpfiles` to autocreate an (empty) file to ensure the service can boot
before actual `htpasswd` contents are registered.

This is safe as restic-rest-server will deny all entry if the file is empty.
2022-01-02 21:13:07 -05:00
pennae
fc614c37c6 nixos/documentation: split options doc build
most modules can be evaluated for their documentation in a very
restricted environment that doesn't include all of nixpkgs. this
evaluation can then be cached and reused for subsequent builds, merging
only documentation that has changed into the cached set. since nixos
ships with a large number of modules of which only a few are used in any
given config this can save evaluation a huge percentage of nixos
options available in any given config.

in tests of this caching, despite having to copy most of nixos/, saves
about 80% of the time needed to build the system manual, or about two
second on the machine used for testing. build time for a full system
config shrank from 9.4s to 7.4s, while turning documentation off
entirely shortened the build to 7.1s.
2022-01-02 19:46:13 +01:00
Lyndon Sanche
c7008f8fdf
nixos/duplicati: Add dataDir to service
Other services such as minecraft-server and plex allow configuration of
the dataDir option, allowing the files stored by each service to be in a
custom location.

Co-authored-by: Aaron Andersen <aaron@fosslib.net>
2021-12-29 08:35:41 -07:00
Graham Christensen
06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
Nikolay Amiantov
759f4afc65
tarsnap service: fix escaping (#150802) 2021-12-16 16:53:59 +03:00
pennae
1060fefae3 nixos/tarsnap, nixos/neo4j: defaultText for submodule options
unfortunately we don't have a good way to represent defaults that
reference other values of the current submodule, so we just use the
relative path of the referenced value and assume that the submodule was
declared as `rec`.
2021-12-09 01:42:24 +01:00
pennae
9407761763 treewide: add defaultText for options using other shortcut bindings 2021-12-09 01:42:24 +01:00
ajs124
eee45bb295
Merge pull request #146815 from ElvishJerricco/systemd-utils-expressions
Move systemd-lib.nix and systemd-unit-options.nix into utils
2021-12-08 15:07:28 +00:00
Robert Hensing
862d167f17
Merge pull request #147441 from pennae/option-doc-staticizing
nixos/*: add trivial defaultText to options where applicable
2021-12-06 01:35:38 +01:00
Kerstin Humm
ac8a9c3f03
Revert "nixos/borgbackup: specify systemd WorkingDirectory"
This reverts commit 62ab77a322.

This broke nixosTests.borgbackup:
https://github.com/NixOS/nixpkgs/pull/143995#issuecomment-985136152
2021-12-03 12:21:13 +01:00
pennae
2512455639 nixos/*: add trivial defaultText for options with simple defaults 2021-12-02 22:35:04 +01:00
Will Fancher
851495a752 Move systemd-lib.nix and systemd-unit-options.nix into utils 2021-11-20 17:52:29 -05:00
Kerstin Humm
62ab77a322
nixos/borgbackup: specify systemd WorkingDirectory 2021-10-31 13:39:46 +01:00
eyjhb
75d64a336b nixos/restic: rename s3CredentialsFile to environmentFile
This is done as the s3CredentialsFile specifies the environmentFile
for the systemd service, which can be used for more than just s3.

Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2021-10-26 14:01:32 -07:00
pennae
1fa5e13f30 nixos/borgbackup: allow dump scripts as stdin inputs
borg is able to process stdin during backups when backing up the special path -,
which can be very useful for backing up things that can be streamed (eg database
dumps, zfs snapshots).
2021-10-22 16:31:50 -04:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Wei Tang
3158087c78
tarsnap: always ping ipv4 address in preStart 2021-09-29 03:09:13 +02:00
Elis Hirwing
f5f386d297
nixos/syncoid: Delegate permissions to parent dataset if target is missing
This is to address a regression introduced in #131118.

When syncing the first dataset, syncoid expects that the target
dataset doesn't exist to have a clean slate to work with. So during
runtime we'll check if the target dataset does exist and if it doesn't
- delegate the permissions to the parent dataset instead.

But then, on unallow, we do the unallow on both the target and the
parent since the target dataset should have been created at this
point, so the unallow can't know which dataset that got permissions
just by which datasets exists.
2021-09-27 19:29:14 +02:00
github-actions[bot]
1db0c42d5a
Merge master into staging-next 2021-09-14 00:01:23 +00:00
Guillaume Girol
3592034595
Merge pull request #133166 from symphorien/nonogroup
Don't default to nogroup for the primary group of users.
2021-09-13 18:29:21 +00:00
Guillaume Girol
bc3bca822a nixos: define the primary group of users where needed 2021-09-12 14:59:30 +02:00
github-actions[bot]
3f7ad651c7
Merge master into staging-next 2021-09-10 06:01:06 +00:00
Elis Hirwing
eac6215607
Merge pull request #136460 from misuzu/sanoid-recursive-zfs
nixos/sanoid: allow zfs value for recursive
2021-09-10 07:13:12 +02:00
github-actions[bot]
912b8082df
Merge master into staging-next 2021-09-10 00:01:31 +00:00
Alyssa Ross
c9ce275aa4
treewide: "does not exists" -> "does not exist"
I noticed this minor grammar mistake when running update.nix, and then
while grepping to find the source I noticed we had it a few times in
Nixpkgs.  Just as easy to fix treewide as it was to fix the one
occurrence I noticed.
2021-09-09 18:45:33 +00:00
misuzu
df972a3dde nixos/sanoid: allow zfs value for recursive 2021-09-02 14:56:23 +03:00
ajs124
9000cd88c6
Merge pull request #132916 from helsinki-systems/upd/mariadb
mariadb: 10.5.11 -> 10.6.3, mariadb-galera: 26.4.8 -> 26.4.9, libmysqlclient: 3.1.13 -> 3.2.3
2021-08-19 17:09:35 +02:00
Elis Hirwing
6567c223ef
Merge pull request #133716 from misuzu/syncoid-permissions
nixos/syncoid: add global and per-dataset permissions options
2021-08-18 08:18:56 +02:00
misuzu
6802eb4241 nixos/syncoid: add global and per-dataset permissions options 2021-08-16 10:14:05 +03:00
Robert Hensing
fbafeb7ad5 treewide: runCommandNoCC -> runCommand
This has been synonymous for ~5y.
2021-08-15 17:36:41 +02:00
ajs124
e728a35bfb nixos/automysqlbackup: fix after mariadb 10.6 upgrade
client tries to connect over TCP, which failes because this uses socket auth
2021-08-12 13:22:40 +02:00
Robert Helgesson
bcc7a902d5
nixos postgresql-backup: add compression option
This option allows basic configuration of the compression technique
used in the backup script. Specifically it adds `none` and `zstd` as
new alternatives, keeping `gzip` as the default.
2021-08-05 00:42:16 +02:00
Ben Siraphob
b63a54f81c
Merge pull request #110742 from siraben/deprecate-fold 2021-07-27 15:13:31 +07:00
Elis Hirwing
a9d29a1d0d
nixos/syncoid: Drop ~[at]sync from the systemcallfilter to avoid coredumps 2021-07-26 11:05:45 +02:00
Elis Hirwing
ea9d5876a0
nixos/sanoid: Reformat file with nixpkgs-fmt 2021-07-26 11:05:37 +02:00
Elis Hirwing
fa58d89b24
nixos/syncoid: Reformat file with nixpkgs-fmt 2021-07-26 11:04:28 +02:00
Elis Hirwing
b9f98165ab
nixos/sanoid: Use a function to build allow/unallow commands 2021-07-26 11:03:35 +02:00
Elis Hirwing
ecd32b8104
nixos/syncoid: Build unallow commands as a post job to drop permissions 2021-07-26 11:02:13 +02:00
Elis Hirwing
bb35e7c404
nixos/sanoid: Extract datasets rather than pools
When making new snapshots we only need to delegate permissions to the
specific dataset rather than the entire pool.
2021-07-25 10:13:17 +02:00
Elis Hirwing
70862830f0
nixos/syncoid: Extract datasets rather than pools
When sending or receiving datasets with the old implementation it
wouldn't matter which dataset we were sending or receiving, we would
always delegate permissions to the entire pool.
2021-07-25 10:12:32 +02:00
Elis Hirwing
6984e68c51
Merge pull request #98455 from ju1m/syncoid-split
nixos/syncoid: split in multiple systemd services and harden them
2021-07-24 22:08:42 +02:00
Julien Moutinho
d05a1ab1e4 nixos/syncoid: split in multiple systemd services 2021-07-24 11:26:28 +02:00
Julien Moutinho
6c72f80b41 nixos/sanoid: fix submodule aliases
Use `mkDefault` into `mkAliasDefitinions`.
This avoids conflicting definitions when using `process_children_only`.
2021-07-15 18:28:27 +02:00
Mario Rodas
bb1ff7da54
Merge pull request #125696 from hercules-ci/postgresql-backup-only-replace-if-successful
nixos/postgresqlBackup: only replace if successful
2021-07-07 18:41:57 -05:00
Guillaume Girol
72894352b8 nixos/btrbk: add module and test 2021-07-03 17:18:20 +02:00
Sandro
30e2735f5d
Merge pull request #83904 from ju1m/sanoid
sanoid: fix sanoid.conf generation
2021-06-30 23:55:26 +02:00
Dima
0a977cf125 nixos/duplicity: fix typo in subcommand
In https://github.com/NixOS/nixpkgs/pull/120622 cleanup options were
added, but `remove-all-inc-of-but-n-full` was misspelled and as such
was not functioning.
2021-06-27 09:40:35 +02:00
Julien Moutinho
b62a093a58 sanoid: fix sanoid.conf generation 2021-06-09 03:25:04 +02:00
Robert Hensing
81c8189a84 nixos/postgresqlBackup: Only replace backup when successful
Previously, a failed backup would always overwrite ${db}.sql.gz,
because the bash `>` redirect truncates the file; even if the
backup was going to fail.
On the next run, the ${db}.prev.sql.gz backup would be
overwritten by the bad ${db}.sql.gz.

Now, if the backup fails, the ${db}.in-progress.sql.gz is in an
unknown state, but ${db}.sql.gz will not be written.
On the next run, ${db}.prev.sql.gz (our only good backup) will
not be overwritten because ${db}.sql.gz does not exist.
2021-06-05 15:09:27 +02:00
talyz
59e0120aa5
treewide: Fix mysql alias deprecation breakage
62733b37b4 broke evaluation in all
places `pkgs.mysql` was used. Fix this by changing all occurrences to
`pkgs.mariadb`.
2021-06-04 21:42:08 +02:00
Robert Hensing
c586e42763 nixos/postgresqlBackup: Use PATH for readability 2021-06-04 17:49:53 +02:00
Domen Kožar
b72c2d3806
duplicati: 2.0.5.1 -> 2.0.6.1, fix nixos module 2021-05-28 10:33:53 +02:00
Sandro
7be85b5090
Merge pull request #104420 from danielfullmer/syncoid-perm-fix 2021-05-22 17:57:56 +02:00
Guillaume Girol
0d5fa1cff3
Merge pull request #120622 from symphorien/duplicity-master
nixos/duplicity: enable to prevent backup from growing infinitely
2021-05-20 19:00:59 +00:00
Guillaume Girol
41c7fa448f nixos/duplicity: add options to exercise all possible verbs
except restore ;)
2021-05-19 12:00:00 +00:00
Martin Weinelt
21746a7c80
nixos/postgresqlBackup: allow defining multiple times to start at
Or … none! Because forcing a string always results in an OnCalender=
setting, but an empty string leads to an empty value.

>  postgresqlBackup-hass.timer: Timer unit lacks value setting. Refusing.

or

> postgresqlBackup-miniflux.timer: Cannot add dependency job, ignoring: Unit postgresqlBackup-miniflux.timer has a bad unit file setting.

I require the postgresqlBackup in my borgbackup unit, so I don't
strictly need the timer and could previously set it to an empty list.
2021-05-14 20:41:08 +02:00
Guillaume Girol
e67e79642e nixos/duplicity: add options to not keep backups forever
Current module add backups forever, with no way to prune old ones.

Add an option to remove backups after n full backups or after some
amount of time.

Also run duplicity cleanup to clean unused files in case some previous
backup was improperly interrupted.
2021-04-25 20:34:38 +02:00
Guillaume Girol
166d5cc851 nixos/duplicity: format 2021-04-25 20:34:38 +02:00
Symphorien Gibol
7a87973b4c nixos/users: require one of users.users.name.{isSystemUser,isNormalUser}
As the only consequence of isSystemUser is that if the uid is null then
it's allocated below 500, if a user has uid = something below 500 then
we don't require isSystemUser to be set.

Motivation: https://github.com/NixOS/nixpkgs/issues/112647
2021-04-14 20:40:00 +02:00
Matt McHenry
13bee29b9b restic: allow prune without backup
fixes #97820
2021-03-21 18:47:52 -07:00
Léo Gaspard
4ee87cfead
Merge pull request #113620 from imlonghao/borgmatic
borgmatic: init at 1.5.12
2021-03-10 18:13:04 +01:00
imlonghao
c026da4056 borgmatic: init at 1.5.12 2021-03-04 13:01:03 +08:00
Cole Helbling
1b37f66fc1 nixos/zrepl: init
zrepl is a ZFS backup and replication tool written in Go.
2021-02-24 11:56:02 -08:00
Sandro
457ff6d28e
Merge pull request #111422 from helsinki-systems/mysqlBackup
nixos/mysqlBackup: add types
2021-02-01 12:39:53 +01:00
Fritz Otlinghaus
929bf6e678
nixos/postgresqlBackup: add types 2021-01-31 15:08:12 +01:00
Fritz Otlinghaus
b9d5ecf80b
nixos/mysqlBackup: add types 2021-01-31 15:06:50 +01:00
Elias Probst
27da11972d nixos/restic: correct location of cache directory
By default, restic determines the location of the cache based on the XDG
base dir specification, which is `~/.cache/restic` when the environment
variable `$XDG_CACHE_HOME` isn't set.
As restic is executed as root by default, this resulted in the cache being
written to `/root/.cache/restic`, which is not quite right for a system
service and also meant, multiple backup services would use the same cache
directory - potentially causing issues with locking, data corruption,
etc.

The goal was to ensure, restic uses the correct cache location for a
system service - one cache per backup specification, using `/var/cache`
as the base directory for it.

systemd sets the environment variable `$CACHE_DIRECTORY` once
`CacheDirectory=` is defined, but restic doesn't change its behavior
based on the presence of this environment variable.
Instead, the specifier [1] `%C` can be used to point restic explicitly
towards the correct cache location using the `--cache-dir` argument.

Furthermore, the `CacheDirectoryMode=` was set to `0700`, as the default
of `0755` is far too open in this case, as the cache might contain
sensitive data.

[1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers
2021-01-30 18:24:51 -08:00
Ben Siraphob
1c2a2b0a08 treewide: fold -> foldr 2021-01-26 10:57:07 +07:00
Fritz Otlinghaus
41f4784e65
bacula: add types 2021-01-25 19:00:01 +01:00
volth
bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
Lorenzo Manacorda
b6356c6e2e modules/tarsnap: document timestamp format 2021-01-10 16:47:15 +02:00
Graham Christensen
bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Daniel Fullmer
d87903ac6b nixos/syncoid: fix permissions without --no-sync-snap
After 733acfa140, syncoid would fail to
run if commonArgs did not include [ "--no-sync-snap" ], since it would
not have permissions to create or destroy snapshots.
2020-11-21 17:47:36 -08:00
Benjamin Hipple
f98312fcb5
Merge pull request #79759 from lopsided98/syncoid-no-root
nixos/syncoid: automatically setup privilege delegation
2020-10-25 10:40:33 -04:00
Jan Tojnar
e6ce041cae
nixos/doc: Improve code listings
By adding prompts and replaceables and removing unnecessary indentation.
2020-09-23 01:25:25 +02:00
Maximilian Bosch
cac5339531
nixos/doc/borgbackup: correct install instructions for vorta
No need to fiddle around with `flatpack` to get `vorta`, a graphical
desktop-client for `borgbackup` running as it's available in `nixpkgs`.
2020-09-06 22:44:37 +02:00
rnhmjoj
20d491a317
treewide: completely remove types.loaOf 2020-09-02 00:42:50 +02:00
Jörg Thalheim
ba930d8679
nixos/modules: remove trailing whitespace
This leads to ci failure otherwise if the file gets changed.
git-blame can ignore whitespace changes.
2020-08-07 14:45:39 +01:00
Jörg Thalheim
1476c6f349
Merge pull request #91146 from tmplt/doc-zfs-replicate
nixos/zfs-replication: document expected lz4 on host system
2020-08-04 08:46:06 +01:00
Imran Hossain
7dd656a037 nixos/restic: Add options for rclone repositories 2020-07-06 10:27:55 -04:00
tmplt
a30294388c nixos/zfs-replication: document expected lz4 on host system 2020-06-24 19:41:36 +02:00
Silvan Mosberger
6440000547
Merge pull request #87599 from helsinki-systems/znapzend-oracle-mode 2020-05-12 15:39:25 +02:00
Michel Weitbrecht
90533bfde2
nixos/znapzend: Add oracleMode feature; add maintainer
The feature destroys snapshots one-by-one instead of all at once.
If many snapshots accumulated, destroying them all at once can fail
because the argument list is too long. See
https://github.com/oetiker/znapzend/blob/master/lib/ZnapZend/ZFS.pm#L284
2020-05-11 14:35:30 +02:00
Michel Weitbrecht
c46b26b9ad
nixos/znapzend: Use generic mbuffer path
The configured mbuffer path will be called on both the source and target
system. If you use pkgs.mbuffer from the source host and the target host
does not have this exact derivation, you will get a broken pipe when
sending snapshots. This is the case when transferring to a non-NixOS
system or to a host with a different mbuffer version.
2020-05-11 14:26:39 +02:00
Jörg Thalheim
ff0da3ad81
Merge pull request #83257 from rail/znapzend-0.20.0 2020-05-05 15:20:15 +01:00
Dominik Xaver Hörl
0412bde942 treewide: add bool type to enable options, or make use of mkEnableOption
Add missing type information to manually specified enable options or replace them by mkEnableOption where appropriate.
2020-04-21 08:55:36 +02:00
Silvan Mosberger
eb0148e90b
Merge pull request #84074 from Infinisil/fix-literal-option-examples
nixos/treewide: Fix incorrectly rendered examples
2020-04-03 15:41:53 +02:00
Jörg Thalheim
35359bb3e3
nixos/borgbackup: fix evaluation 2020-04-02 12:40:02 +01:00
Silvan Mosberger
1d0fc9729d
nixos/treewide: Fix incorrectly rendered examples
Many options define their example to be a Nix value without using
literalExample. This sometimes gets rendered incorrectly in the manual,
causing confusion like in https://github.com/NixOS/nixpkgs/issues/25516

This fixes it by using literalExample for such options. The list of
option to fix was determined with this expression:

  let
    nixos = import ./nixos { configuration = {}; };
    lib = import ./lib;
    valid = d: {
      # escapeNixIdentifier from https://github.com/NixOS/nixpkgs/pull/82461
      set = lib.all (n: lib.strings.escapeNixIdentifier n == n) (lib.attrNames d) && lib.all (v: valid v) (lib.attrValues d);
      list = lib.all (v: valid v) d;
    }.${builtins.typeOf d} or true;

    optionList = lib.optionAttrSetToDocList nixos.options;

  in map (opt: {
    file = lib.elemAt opt.declarations 0;
    loc = lib.options.showOption opt.loc;
  }) (lib.filter (opt: if opt ? example then ! valid opt.example else false) optionList)

which when evaluated will output all options that use a Nix identifier
that would need escaping as an attribute name.
2020-04-02 07:49:25 +02:00
Niklaus Giger
c027937d9a borgbackup: Moved documentation to NixOS manual and added examples for
* creating a local backup
* creating a borgbackup server
* backing up to a borgbackup server
* hints about the Vorta graphical desktop application
* Added documentation about Vorta desktop client

Tested the examples locally and with my borgbase.com account.
2020-04-01 22:21:10 +02:00
Rail Aliiev
ba7e3c6cba
Add new znapzend features to modules 2020-03-23 21:29:49 -04:00
Ben Wolsieffer
733acfa140 nixos/syncoid: automatically setup privilege delegation 2020-03-09 16:04:31 -04:00
Silvan Mosberger
637bb9fa98
Merge pull request #72060 from lopsided98/sanoid-init
sanoid: add package, NixOS module and test
2020-02-10 01:28:41 +01:00
Ben Wolsieffer
7684537e33
nixos/sanoid, nixos/syncoid: init module and test 2020-02-10 01:12:39 +01:00
Matt McHenry
5ad71cfe84
fix pruneCmd to use optionals so multi-element list is preserved 2020-02-07 10:25:33 +00:00
Jörg Thalheim
4fa2d4b5c3
nixos/restic: use optionalString/optionalAttrs where possible 2020-01-30 17:07:21 +00:00
Matt McHenry
1c9684abd6
restic: add dynamicFilesFrom 2020-01-30 17:00:10 +00:00
Matt McHenry
c6994e90dc
restic: add support for pruning 2020-01-30 16:59:34 +00:00
rnhmjoj
1d61efb7f1 treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
Yorick van Pelt
470c8a2a36 nixos/borgbackup: install job wrappers to systemPackages for easy borg access
Currently to run borg job manually, you have to use systemctl:
```
$ systemctl start borgbackup-job-jobname.service
```

This commit makes wrappers around borg jobs available in $PATH, which have
BORG_REPO and connection args set correctly:
```
$ borg-job-jobname list
$ borg-job-jobname mount ::jobname-archive-2019-12-25T00:01:29 /mnt/some-path
$ borg-job-jobname create ::test /some/path
```

Closes: https://github.com/NixOS/nixpkgs/pull/64888
Co-authored-by: Danylo Hlynskyi <abcz2.uprola@gmail.com>
2019-12-26 07:50:03 +02:00
Christian Kampka
2387deec3d
postgresql-backup: Use saner defaults for pg_dump 2019-12-15 13:14:21 +01:00
wucke13
93696e3c1f nixos/bacula-sd: add autochange support
+ Fixing interrupted descriptions
+ Added more verbose descriptions
+ Addded <literal> to the descriptions
+ uniformly reformated descriptions to break at 80 chars

(cherry picked from commit c7945c8a97df52a468cf32155154cdec021561bc)
2019-12-11 19:16:50 +01:00
Silvan Mosberger
4ee3e8b21d
nixos/treewide: Move rename.nix imports to their respective modules
A centralized list for these renames is not good because:
- It breaks disabledModules for modules that have a rename defined
- Adding/removing renames for a module means having to find them in the
central file
- Merge conflicts due to multiple people editing the central file
2019-12-10 02:51:19 +01:00
Silvan Mosberger
dd0a47e7ae
treewide: Switch to system users (#71055)
treewide: Switch to system users
2019-11-01 13:26:43 +01:00
Silvan Mosberger
f124b7addc
nixos/znapzend: Increase starting timeout 2019-10-27 12:29:31 +01:00