mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
29 lines
626 B
Nix
29 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" ];
|
|
};
|
|
}
|