From c33125ae05eb1b1ce18f2f0d7f37a8b530a44d6c Mon Sep 17 00:00:00 2001 From: Tyler Starr Date: Tue, 12 Nov 2024 10:09:03 -0800 Subject: [PATCH] add appgate with overlay and wrapper --- provision/hosts/osprey/configuration.nix | 2 +- provision/modules/programs/appgate-sdp.nix | 36 ++++++++++++++++++++++ provision/modules/programs/default.nix | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 provision/modules/programs/appgate-sdp.nix diff --git a/provision/hosts/osprey/configuration.nix b/provision/hosts/osprey/configuration.nix index ca05f9eb..e128874b 100644 --- a/provision/hosts/osprey/configuration.nix +++ b/provision/hosts/osprey/configuration.nix @@ -25,7 +25,6 @@ docker-compose podman-tui dive - appgate-sdp ]; # Modules @@ -37,6 +36,7 @@ programs = { chezmoi.apply = true; kitty.enable = true; + appgate-sdp.enable = true; }; services = { peripherals.enable = true; diff --git a/provision/modules/programs/appgate-sdp.nix b/provision/modules/programs/appgate-sdp.nix new file mode 100644 index 00000000..46ba7ac9 --- /dev/null +++ b/provision/modules/programs/appgate-sdp.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, user, ... }: + +let cfg = config.modules.programs.appgate-sdp; +in { + options.modules.programs.appgate-sdp.enable = lib.mkEnableOption "appgate-sdp"; + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + appgate-sdp + (pkgs.writeScriptBin "appgate-sdp-wrapped" '' + #!/bin/sh + appgate + sudo systemctl restart resolvconf.service + '') + ]; + home-manager.users.${user} = { + # Custom entry that uses wrapped binary + xdg.desktopEntries.appgate = { + name="Appgate SDP"; + exec="pkexec appgate-sdp-wrapped"; + icon="appgate-icon"; + terminal = false; + type = "Application"; + mimeType= ["x-scheme-handler/appgate"]; + categories= ["Network"]; + }; + }; + + boot.kernelModules = [ "tun" ]; + services.dbus.packages = [ pkgs.appgate-sdp ]; + systemd = { + packages = [ pkgs.appgate-sdp ]; + # https://github.com/NixOS/nixpkgs/issues/81138 + services.appgatedriver.wantedBy = [ "multi-user.target" ]; + }; + }; +} diff --git a/provision/modules/programs/default.nix b/provision/modules/programs/default.nix index b44a6d09..dffb75a0 100644 --- a/provision/modules/programs/default.nix +++ b/provision/modules/programs/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./appgate-sdp.nix ./beancount.nix ./chrome ./firefox