Describe the bug
The NixOS Caddy module allows to set the Caddy package to use. The default package is caddy, and I would expect setting services.caddy.package to pkgs.caddy2 would allow me to use Caddy 2. Instead, the service fails to start.
To Reproduce
configuration.nix: services.caddy = {
enable = true;
agree = true;
package = pkgs.caddy2;
config = "";
};
nixos-rebuild switchjournalctl -u caddy, you'll see Jul 12 10:28:10 nixos caddy[16485]: [ERROR] first argument must be a subcommand; see 'caddy help'. The Caddy service is not runningExpected behavior
The caddy service starts successfully.
Notify maintainers
@filalex77 @rushmorem @fpletz @zimbatm
Metadata
- system: `"x86_64-linux"`
- host os: `Linux 5.4.35, NixOS, 20.03.1596.2faa76db27c (Markhor)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.4`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module: caddy
Thanks for the issue! Please see #86686 for progress on Caddy v2. After it's merged, Caddy v2 will be used by default.
Fixed by https://github.com/NixOS/nixpkgs/pull/97217. :tada: Thanks @filalex77 !
Most helpful comment
Thanks for the issue! Please see #86686 for progress on Caddy v2. After it's merged, Caddy v2 will be used by default.