Cloudflared service not found

My cloudflared.nix file is below; I explicitly enable cloudflared and add the package to the system, but when I run systemctl status cloudflared I get “Unit cloudflared.service could not be found.” Why is the cloudflared service not being installed?

# cloudflared.nix

{ config, pkgs, ... }:
{
  services.cloudflared = {
    enable = true;
    tunnels = {
      "<tunnel-id>" = {
        credentialsFile = "/home/sam/.cloudflared/<tunnel-id>.json";
        default = "http_status:404";
      };
    };
  };

  environment.systemPackages = with pkgs; [
    cloudflared
  ];
}

Looking at the source file that generates the systemd file, it looks like the naming pattern is different: cloudflared-tunnel-${name} where name would be the tunnel-id I believe.

Interesting, I’ll try this. I think the Wiki needs to be updated if this works.

This was my misunderstanding. Coming back to this with fresh eyes I ran systemctl status cloudflared-tunnel-<tunnel-id> and it worked. Everything is working as intended. Thanks!