mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-17 01:51:10 +02:00
fix: victoriametrics (#172)
* chore: update aqua's host key * fix: victoriametrics * feat: adjust order of nix cache mirrors * feat: update mysecrets * fix: use bind mount - Failed at step STATE_DIRECTORY
This commit is contained in:
@@ -3,13 +3,23 @@
|
||||
myvars,
|
||||
...
|
||||
}: {
|
||||
# Since victoriametrics use DynamicUser, the user & group do not exists before the service starts.
|
||||
# this group is used as a supplementary Unix group for the service to access our data dir(/data/apps/xxx)
|
||||
users.groups.victoriametrics-data = {};
|
||||
|
||||
# Workaround for victoriametrics to store data in another place
|
||||
# https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html#Type
|
||||
systemd.tmpfiles.rules = [
|
||||
"D /data/apps/victoriametrics 0751 victoriametrics victoriametrics - -"
|
||||
"L+ /var/lib/victoriametrics - - - - /data/apps/victoriametrics"
|
||||
"D /data/apps/victoriametrics 0770 root victoriametrics-data - -"
|
||||
];
|
||||
|
||||
# Symlinks do not work with DynamicUser, so we should use bind mount here.
|
||||
# https://github.com/systemd/systemd/issues/25097#issuecomment-1929074961
|
||||
systemd.services.victoriametrics.serviceConfig = {
|
||||
SupplementaryGroups = ["victoriametrics-data"];
|
||||
BindPaths = ["/data/apps/victoriametrics:/var/lib/victoriametrics:rbind"];
|
||||
};
|
||||
|
||||
# https://victoriametrics.io/docs/victoriametrics/latest/configuration/configuration/
|
||||
services.my-victoriametrics = {
|
||||
enable = true;
|
||||
|
||||
Reference in New Issue
Block a user