privatemounts = false is required if snap is separate from the backup service.
This commit is contained in:
parent
e782f7c268
commit
4a4cce4e94
1 changed files with 7 additions and 9 deletions
|
@ -3,9 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.mySystem.services.zfs-nightly-snap;
|
cfg = config.mySystem.services.zfs-nightly-snap;
|
||||||
|
|
||||||
# Replaces/Creates and mounts a ZFS snapshot
|
# Replaces/Creates and mounts a ZFS snapshot
|
||||||
|
@ -62,8 +60,7 @@ let
|
||||||
mount | grep "$BACKUP_DIRECTORY"
|
mount | grep "$BACKUP_DIRECTORY"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.mySystem.services.zfs-nightly-snap = {
|
options.mySystem.services.zfs-nightly-snap = {
|
||||||
enable = lib.mkEnableOption "ZFS nightly snapshot service";
|
enable = lib.mkEnableOption "ZFS nightly snapshot service";
|
||||||
|
|
||||||
|
@ -115,6 +112,7 @@ in
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${resticSnapAndMount}/bin/zfs-nightly-snap";
|
ExecStart = "${resticSnapAndMount}/bin/zfs-nightly-snap";
|
||||||
|
PrivateMounts = "no"; # We want to mount the snapshot to the system
|
||||||
};
|
};
|
||||||
requires = ["zfs.target"];
|
requires = ["zfs.target"];
|
||||||
after = ["zfs.target"];
|
after = ["zfs.target"];
|
||||||
|
|
Loading…
Reference in a new issue