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
693 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 "Twingate Client daemon";
package = lib.mkPackageOption 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 --update=none ${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 = lib.mkIf (!config.networking.networkmanager.enable) true;
2022-11-04 12:36:45 +00:00
environment.systemPackages = [ cfg.package ]; # For the CLI.
2022-11-04 12:36:45 +00:00
};
}