Merge pull request #221964 from randomnetcat/sanoid-service-package
sanoid/syncoid: Add package options
This commit is contained in:
commit
003c2e3957
2 changed files with 6 additions and 2 deletions
|
@ -114,6 +114,8 @@ in
|
|||
options.services.sanoid = {
|
||||
enable = mkEnableOption (lib.mdDoc "Sanoid ZFS snapshotting service");
|
||||
|
||||
package = lib.mkPackageOptionMD pkgs "sanoid" {};
|
||||
|
||||
interval = mkOption {
|
||||
type = types.str;
|
||||
default = "hourly";
|
||||
|
@ -181,7 +183,7 @@ in
|
|||
ExecStartPre = (map (buildAllowCommand "allow" [ "snapshot" "mount" "destroy" ]) datasets);
|
||||
ExecStopPost = (map (buildAllowCommand "unallow" [ "snapshot" "mount" "destroy" ]) datasets);
|
||||
ExecStart = lib.escapeShellArgs ([
|
||||
"${pkgs.sanoid}/bin/sanoid"
|
||||
"${cfg.package}/bin/sanoid"
|
||||
"--cron"
|
||||
"--configdir"
|
||||
(pkgs.writeTextDir "sanoid.conf" configFile)
|
||||
|
|
|
@ -87,6 +87,8 @@ in
|
|||
options.services.syncoid = {
|
||||
enable = mkEnableOption (lib.mdDoc "Syncoid ZFS synchronization service");
|
||||
|
||||
package = lib.mkPackageOptionMD pkgs "sanoid" {};
|
||||
|
||||
interval = mkOption {
|
||||
type = types.str;
|
||||
default = "hourly";
|
||||
|
@ -331,7 +333,7 @@ in
|
|||
ExecStopPost =
|
||||
(map (buildUnallowCommand c.localSourceAllow) (localDatasetName c.source)) ++
|
||||
(map (buildUnallowCommand c.localTargetAllow) (localDatasetName c.target));
|
||||
ExecStart = lib.escapeShellArgs ([ "${pkgs.sanoid}/bin/syncoid" ]
|
||||
ExecStart = lib.escapeShellArgs ([ "${cfg.package}/bin/syncoid" ]
|
||||
++ optionals c.useCommonArgs cfg.commonArgs
|
||||
++ optional c.recursive "-r"
|
||||
++ optionals (c.sshKey != null) [ "--sshkey" c.sshKey ]
|
||||
|
|
Loading…
Reference in a new issue