mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Add package option to Nix modules
"Package" option allows specifying the derivation that will be used for the systemd service. Works the same way as `services.<name>.package` in NixOS. By default picks the docspell packages from pkgs instance -- same behavior as prior to this commit Closes #2627
This commit is contained in:
@ -306,6 +306,7 @@ in {
|
|||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable docspell docspell job executor.";
|
description = "Whether to enable docspell docspell job executor.";
|
||||||
};
|
};
|
||||||
|
package = mkPackageOption pkgs "docspell-joex" {};
|
||||||
runAs = mkOption {
|
runAs = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
@ -1777,7 +1778,7 @@ in {
|
|||||||
|
|
||||||
systemd.services.docspell-joex = let
|
systemd.services.docspell-joex = let
|
||||||
args = builtins.concatStringsSep " " cfg.jvmArgs;
|
args = builtins.concatStringsSep " " cfg.jvmArgs;
|
||||||
cmd = "${pkgs.docspell-joex}/bin/docspell-joex ${args} -- ${configFile}";
|
cmd = "${lib.getExe' cfg.package "docspell-joex"} ${args} -- ${configFile}";
|
||||||
waitTarget =
|
waitTarget =
|
||||||
if cfg.waitForTarget != null
|
if cfg.waitForTarget != null
|
||||||
then [cfg.waitForTarget]
|
then [cfg.waitForTarget]
|
||||||
|
@ -150,6 +150,7 @@ in {
|
|||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable docspell.";
|
description = "Whether to enable docspell.";
|
||||||
};
|
};
|
||||||
|
package = mkPackageOption pkgs "docspell-restserver" {};
|
||||||
runAs = mkOption {
|
runAs = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
@ -878,7 +879,7 @@ in {
|
|||||||
|
|
||||||
systemd.services.docspell-restserver = let
|
systemd.services.docspell-restserver = let
|
||||||
args = builtins.concatStringsSep " " cfg.jvmArgs;
|
args = builtins.concatStringsSep " " cfg.jvmArgs;
|
||||||
cmd = "${pkgs.docspell-restserver}/bin/docspell-restserver ${args} -- ${configFile}";
|
cmd = "${lib.getExe' cfg.package "docspell-restserver"} ${args} -- ${configFile}";
|
||||||
in {
|
in {
|
||||||
description = "Docspell Rest Server";
|
description = "Docspell Rest Server";
|
||||||
after = ["networking.target"];
|
after = ["networking.target"];
|
||||||
|
Reference in New Issue
Block a user