depot/third_party/nixpkgs/nixos/modules/services/networking/twingate.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

28 lines
626 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.twingate;
in {
options.services.twingate = {
enable = mkEnableOption (lib.mdDoc "Twingate Client daemon");
};
config = mkIf cfg.enable {
networking.firewall.checkReversePath = lib.mkDefault false;
networking.networkmanager.enable = true;
environment.systemPackages = [ pkgs.twingate ]; # for the CLI
systemd.packages = [ pkgs.twingate ];
systemd.services.twingate.preStart = ''
cp -r -n ${pkgs.twingate}/etc/twingate/. /etc/twingate/
'';
systemd.services.twingate.wantedBy = [ "multi-user.target" ];
};
}