nyx/modules/nixos/services/cloudflared.nix
2024-10-25 16:45:25 +03:00

24 lines
592 B
Nix

{ pkgs, inputs, ... }:
let
secrets = import ../../../secrets/secrets.nix;
in
{
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=${secrets.cloudflared.nyx.token}";
Restart = "always";
User = "cloudflared";
Group = "cloudflared";
};
};
}