1
0
Fork 0
dotfiles/system/nixos/cloudflared.nix

22 lines
536 B
Nix
Raw Normal View History

2022-12-26 16:53:21 +00:00
{ pkgs, secret, ... }:
{
users.users.cloudflared = {
group = "cloudflared";
isSystemUser = true;
};
users.groups.cloudflared = { };
2022-12-26 16:58:03 +00:00
systemd.services.cloudflared-sail = {
2022-12-26 16:53:21 +00:00
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" "systemd-resolved.service" ];
serviceConfig = {
ExecStart = "${pkgs.cloudflared}/bin/cloudflared tunnel --no-autoupdate run --token=${secret.cloudflared.token}";
Restart = "always";
User = "cloudflared";
Group = "cloudflared";
};
};
}