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 = {
|
options.services.sanoid = {
|
||||||
enable = mkEnableOption (lib.mdDoc "Sanoid ZFS snapshotting service");
|
enable = mkEnableOption (lib.mdDoc "Sanoid ZFS snapshotting service");
|
||||||
|
|
||||||
|
package = lib.mkPackageOptionMD pkgs "sanoid" {};
|
||||||
|
|
||||||
interval = mkOption {
|
interval = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "hourly";
|
default = "hourly";
|
||||||
|
@ -181,7 +183,7 @@ in
|
||||||
ExecStartPre = (map (buildAllowCommand "allow" [ "snapshot" "mount" "destroy" ]) datasets);
|
ExecStartPre = (map (buildAllowCommand "allow" [ "snapshot" "mount" "destroy" ]) datasets);
|
||||||
ExecStopPost = (map (buildAllowCommand "unallow" [ "snapshot" "mount" "destroy" ]) datasets);
|
ExecStopPost = (map (buildAllowCommand "unallow" [ "snapshot" "mount" "destroy" ]) datasets);
|
||||||
ExecStart = lib.escapeShellArgs ([
|
ExecStart = lib.escapeShellArgs ([
|
||||||
"${pkgs.sanoid}/bin/sanoid"
|
"${cfg.package}/bin/sanoid"
|
||||||
"--cron"
|
"--cron"
|
||||||
"--configdir"
|
"--configdir"
|
||||||
(pkgs.writeTextDir "sanoid.conf" configFile)
|
(pkgs.writeTextDir "sanoid.conf" configFile)
|
||||||
|
|
|
@ -87,6 +87,8 @@ in
|
||||||
options.services.syncoid = {
|
options.services.syncoid = {
|
||||||
enable = mkEnableOption (lib.mdDoc "Syncoid ZFS synchronization service");
|
enable = mkEnableOption (lib.mdDoc "Syncoid ZFS synchronization service");
|
||||||
|
|
||||||
|
package = lib.mkPackageOptionMD pkgs "sanoid" {};
|
||||||
|
|
||||||
interval = mkOption {
|
interval = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "hourly";
|
default = "hourly";
|
||||||
|
@ -331,7 +333,7 @@ in
|
||||||
ExecStopPost =
|
ExecStopPost =
|
||||||
(map (buildUnallowCommand c.localSourceAllow) (localDatasetName c.source)) ++
|
(map (buildUnallowCommand c.localSourceAllow) (localDatasetName c.source)) ++
|
||||||
(map (buildUnallowCommand c.localTargetAllow) (localDatasetName c.target));
|
(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
|
++ optionals c.useCommonArgs cfg.commonArgs
|
||||||
++ optional c.recursive "-r"
|
++ optional c.recursive "-r"
|
||||||
++ optionals (c.sshKey != null) [ "--sshkey" c.sshKey ]
|
++ optionals (c.sshKey != null) [ "--sshkey" c.sshKey ]
|
||||||
|
|
Loading…
Reference in a new issue