Merge pull request #2630 from VTimofeenko/feat-add-package-option-to-nix-modules

Add package option to Nix modules
This commit is contained in:
eikek 2024-05-06 19:57:35 +02:00 committed by GitHub
commit 66136b7d0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -306,6 +306,7 @@ in {
default = false;
description = "Whether to enable docspell docspell job executor.";
};
package = mkPackageOption pkgs "docspell-joex" {};
runAs = mkOption {
type = types.nullOr types.str;
default = null;
@ -1777,7 +1778,7 @@ in {
systemd.services.docspell-joex = let
args = builtins.concatStringsSep " " cfg.jvmArgs;
cmd = "${pkgs.docspell-joex}/bin/docspell-joex ${args} -- ${configFile}";
cmd = "${lib.getExe' cfg.package "docspell-joex"} ${args} -- ${configFile}";
waitTarget =
if cfg.waitForTarget != null
then [cfg.waitForTarget]

View File

@ -150,6 +150,7 @@ in {
default = false;
description = "Whether to enable docspell.";
};
package = mkPackageOption pkgs "docspell-restserver" {};
runAs = mkOption {
type = types.nullOr types.str;
default = null;
@ -878,7 +879,7 @@ in {
systemd.services.docspell-restserver = let
args = builtins.concatStringsSep " " cfg.jvmArgs;
cmd = "${pkgs.docspell-restserver}/bin/docspell-restserver ${args} -- ${configFile}";
cmd = "${lib.getExe' cfg.package "docspell-restserver"} ${args} -- ${configFile}";
in {
description = "Docspell Rest Server";
after = ["networking.target"];