mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
hedgedoc: use lib.mkPackageOptionMD
This commit is contained in:
parent
f310ee473d
commit
a521506834
@ -32,6 +32,7 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
options.services.hedgedoc = {
|
options.services.hedgedoc = {
|
||||||
|
package = mkPackageOptionMD pkgs "hedgedoc" { };
|
||||||
enable = mkEnableOption (lib.mdDoc "the HedgeDoc Markdown Editor");
|
enable = mkEnableOption (lib.mdDoc "the HedgeDoc Markdown Editor");
|
||||||
|
|
||||||
groups = mkOption {
|
groups = mkOption {
|
||||||
@ -1018,16 +1019,6 @@ in
|
|||||||
`HedgeDoc` is running.
|
`HedgeDoc` is running.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = types.package;
|
|
||||||
default = pkgs.hedgedoc;
|
|
||||||
defaultText = literalExpression "pkgs.hedgedoc";
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Package that provides HedgeDoc.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
@ -1060,7 +1051,7 @@ in
|
|||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
WorkingDirectory = cfg.workDir;
|
WorkingDirectory = cfg.workDir;
|
||||||
StateDirectory = [ cfg.workDir cfg.settings.uploadsPath ];
|
StateDirectory = [ cfg.workDir cfg.settings.uploadsPath ];
|
||||||
ExecStart = "${cfg.package}/bin/hedgedoc";
|
ExecStart = "${lib.getExe cfg.package}";
|
||||||
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
|
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
|
||||||
Environment = [
|
Environment = [
|
||||||
"CMD_CONFIG_FILE=${cfg.workDir}/config.json"
|
"CMD_CONFIG_FILE=${cfg.workDir}/config.json"
|
||||||
|
Loading…
Reference in New Issue
Block a user