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