NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.35k stars 13.59k forks source link

Caddy module doesn't work with caddy2 package #92992

Closed sephii closed 4 years ago

sephii commented 4 years ago

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
Br1ght0ne commented 4 years ago

Thanks for the issue! Please see #86686 for progress on Caddy v2. After it's merged, Caddy v2 will be used by default.

sephii commented 4 years ago

Fixed by https://github.com/NixOS/nixpkgs/pull/97217. :tada: Thanks @filalex77 !