nyx/modules/nixos/services/cloudflared.nix

25 lines
606 B
Nix
Raw Normal View History

{ lib, config, pkgs, inputs, ... }:
2024-10-25 13:45:25 +00:00
{
imports = [
../../../secrets/secrets.nix
];
2024-10-25 13:45:25 +00:00
users.users.cloudflared = {
group = "cloudflared";
isSystemUser = true;
};
users.groups.cloudflared = { };
systemd.services.my_tunnel = {
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" "systemd-resolved.service" ];
serviceConfig = {
ExecStart = "${pkgs.cloudflared}/bin/cloudflared tunnel --no-autoupdate run --token=${sops.secrets.cloudflared.nyx.token}";
2024-10-25 13:45:25 +00:00
Restart = "always";
User = "cloudflared";
Group = "cloudflared";
};
};
}