Commit graph

238 commits

Author SHA1 Message Date
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