mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
caddy: add package config option
This commit is contained in:
parent
4008370992
commit
5c5648b1f6
1 changed files with 8 additions and 1 deletions
|
@ -39,6 +39,13 @@ in
|
||||||
type = types.path;
|
type = types.path;
|
||||||
description = "The data directory, for storing certificates.";
|
description = "The data directory, for storing certificates.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.caddy;
|
||||||
|
defaultText = "pkgs.caddy";
|
||||||
|
type = types.package;
|
||||||
|
description = "Caddy package to use.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -47,7 +54,7 @@ in
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = ''${pkgs.caddy.bin}/bin/caddy -conf=${configFile} \
|
ExecStart = ''${cfg.package.bin}/bin/caddy -conf=${configFile} \
|
||||||
-ca=${cfg.ca} -email=${cfg.email} ${optionalString cfg.agree "-agree"}
|
-ca=${cfg.ca} -email=${cfg.email} ${optionalString cfg.agree "-agree"}
|
||||||
'';
|
'';
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue