Nixpkgs: Caddy module doesn't work with caddy2 package

Created on 12 Jul 2020  路  2Comments  路  Source: NixOS/nixpkgs

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

  1. Add the following to configuration.nix:
  services.caddy = {
    enable = true;
    agree = true;
    package = pkgs.caddy2;
    config = "";
  };
  1. Run nixos-rebuild switch
  2. Run journalctl -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 running

Expected 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
bug

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.

All 2 comments

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 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthiasbeyer picture matthiasbeyer  路  3Comments

tomberek picture tomberek  路  3Comments

copumpkin picture copumpkin  路  3Comments

sid-kap picture sid-kap  路  3Comments

chris-martin picture chris-martin  路  3Comments