mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
nixos/twingate: init module
This commit is contained in:
parent
3abe0af96b
commit
acf17b3b4b
2 changed files with 29 additions and 0 deletions
|
@ -965,6 +965,7 @@
|
|||
./services/networking/tox-node.nix
|
||||
./services/networking/toxvpn.nix
|
||||
./services/networking/tvheadend.nix
|
||||
./services/networking/twingate.nix
|
||||
./services/networking/ucarp.nix
|
||||
./services/networking/unbound.nix
|
||||
./services/networking/unifi.nix
|
||||
|
|
28
nixos/modules/services/networking/twingate.nix
Normal file
28
nixos/modules/services/networking/twingate.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ 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" ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue