feat(systems): add mount dependencies for services
Ensure proper service execution by adding mount dependencies to systemd services. This guarantees that required file systems are available before the services start.
This commit is contained in:
parent
a8ecc2cfa1
commit
56f9f1c0ae
2 changed files with 13 additions and 10 deletions
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
backup_new_path = "/mnt/raid/backup/hoyer/new/";
|
||||
restic_repo = "/mnt/backup/restic-repo";
|
||||
in
|
||||
{
|
||||
systemd.services."restic-backups-hoyer_new".requires = [ "mnt-raid.mount" ];
|
||||
services.restic.backups.hoyer_new = {
|
||||
repository = restic_repo;
|
||||
passwordFile = config.sops.secrets.backup-pw.path;
|
||||
|
@ -31,6 +31,7 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
systemd.services."restic-backups-self".requires = [ "mnt-backup.mount" ];
|
||||
services.restic.backups.self = {
|
||||
repository = restic_repo;
|
||||
#repository = "s3:nas2a6e8f.myqnapcloud.com:8081/backup";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
systemd.services.netatalk.requires = [ "mnt-backup.mount" "mnt-raid.mount" ];
|
||||
services.netatalk = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
@ -35,6 +35,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
systemd.services.samba.requires = [ "mnt-raid.mount" ];
|
||||
services.samba = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
|
@ -70,6 +71,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
systemd.services.syncthing.requires = [ "mnt-raid.mount" ];
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
user = "harald";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue