nixpkgs/nixos/modules/services/networking/twingate.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
682 B
Nix
Raw Normal View History

2022-11-04 12:36:45 +00:00
{ config, lib, pkgs, ... }:
let
cfg = config.services.twingate;
in
{
2022-11-04 12:36:45 +00:00
options.services.twingate = {
enable = lib.mkEnableOption (lib.mdDoc "Twingate Client daemon");
package = lib.mkPackageOptionMD pkgs "twingate" { };
2022-11-04 12:36:45 +00:00
};
config = lib.mkIf cfg.enable {
systemd.packages = [ cfg.package ];
systemd.services.twingate = {
preStart = "cp -r -n ${cfg.package}/etc/twingate/. /etc/twingate/";
wantedBy = [ "multi-user.target" ];
};
2022-11-04 12:36:45 +00:00
networking.firewall.checkReversePath = lib.mkDefault "loose";
services.resolved.enable = !(config.networking.networkmanager.enable);
2022-11-04 12:36:45 +00:00
environment.systemPackages = [ cfg.package ]; # For the CLI.
2022-11-04 12:36:45 +00:00
};
}