1 { config, lib, pkgs, ... }:
4 cfg = config.services.twingate;
7 options.services.twingate = {
8 enable = lib.mkEnableOption "Twingate Client daemon";
9 package = lib.mkPackageOption pkgs "twingate" { };
12 config = lib.mkIf cfg.enable {
13 systemd.packages = [ cfg.package ];
14 systemd.services.twingate = {
15 preStart = "cp -r --update=none ${cfg.package}/etc/twingate/. /etc/twingate/";
16 wantedBy = [ "multi-user.target" ];
19 networking.firewall.checkReversePath = lib.mkDefault "loose";
20 services.resolved.enable = lib.mkIf (!config.networking.networkmanager.enable) true;
22 environment.systemPackages = [ cfg.package ]; # For the CLI.