diff options
author | zowoq <59103226+zowoq@users.noreply.github.com> | 2020-10-02 17:46:46 +1000 |
---|---|---|
committer | zowoq <59103226+zowoq@users.noreply.github.com> | 2020-10-02 23:50:59 +1000 |
commit | 8f74e9e90541fdc34a4eb228d7dbab5ff761c20d (patch) | |
tree | ab70738945358164a96d4df1761767776dab95c1 /nixos/modules/services/web-servers | |
parent | 9e7e0e9aa1af7001ee368508e019fa8a2ef9972d (diff) | |
download | nixpkgs-8f74e9e90541fdc34a4eb228d7dbab5ff761c20d.tar nixpkgs-8f74e9e90541fdc34a4eb228d7dbab5ff761c20d.tar.gz nixpkgs-8f74e9e90541fdc34a4eb228d7dbab5ff761c20d.tar.bz2 nixpkgs-8f74e9e90541fdc34a4eb228d7dbab5ff761c20d.tar.lz nixpkgs-8f74e9e90541fdc34a4eb228d7dbab5ff761c20d.tar.xz nixpkgs-8f74e9e90541fdc34a4eb228d7dbab5ff761c20d.tar.zst nixpkgs-8f74e9e90541fdc34a4eb228d7dbab5ff761c20d.zip |
nixos/caddy: remove caddy1
Diffstat (limited to 'nixos/modules/services/web-servers')
-rw-r--r-- | nixos/modules/services/web-servers/caddy.nix | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/nixos/modules/services/web-servers/caddy.nix b/nixos/modules/services/web-servers/caddy.nix index dda26fe491a..72bf9a9a1f4 100644 --- a/nixos/modules/services/web-servers/caddy.nix +++ b/nixos/modules/services/web-servers/caddy.nix @@ -6,8 +6,6 @@ let cfg = config.services.caddy; configFile = pkgs.writeText "Caddyfile" cfg.config; - # v2-specific options - isCaddy2 = versionAtLeast cfg.package.version "2.0"; tlsConfig = { apps.tls.automation.policies = [{ issuer = { @@ -50,7 +48,7 @@ in { example = "nginx"; type = types.str; description = '' - Name of the config adapter to use. Not applicable to Caddy v1. + Name of the config adapter to use. See https://caddyserver.com/docs/config-adapters for the full list. ''; }; @@ -90,11 +88,10 @@ in { package = mkOption { default = pkgs.caddy; defaultText = "pkgs.caddy"; - example = "pkgs.caddy1"; + example = "pkgs.caddy"; type = types.package; description = '' Caddy package to use. - To use Caddy v1 (obsolete), set this to <literal>pkgs.caddy1</literal>. ''; }; }; @@ -106,21 +103,9 @@ in { after = [ "network-online.target" ]; wants = [ "network-online.target" ]; # systemd-networkd-wait-online.service wantedBy = [ "multi-user.target" ]; - environment = mkIf (versionAtLeast config.system.stateVersion "17.09" && !isCaddy2) - { CADDYPATH = cfg.dataDir; }; serviceConfig = { - ExecStart = if isCaddy2 then '' - ${cfg.package}/bin/caddy run --config ${configJSON} - '' else '' - ${cfg.package}/bin/caddy -log stdout -log-timestamps=false \ - -root=/var/tmp -conf=${configFile} \ - -ca=${cfg.ca} -email=${cfg.email} ${optionalString cfg.agree "-agree"} - ''; - ExecReload = - if isCaddy2 then - "${cfg.package}/bin/caddy reload --config ${configJSON}" - else - "${pkgs.coreutils}/bin/kill -USR1 $MAINPID"; + ExecStart = "${cfg.package}/bin/caddy run --config ${configJSON}"; + ExecReload = "${cfg.package}/bin/caddy reload --config ${configJSON}"; Type = "simple"; User = "caddy"; Group = "caddy"; |