diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-29 02:02:23 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-29 03:50:32 +0530 |
| commit | 41bdeb88009dd232808edee9fc0e4ae94358d8d6 (patch) | |
| tree | c1a41f54e086064dac178ebed24d36ab34087c32 /modules/networking/usque/default.nix | |
| parent | 530299d97926d45939f831dc3ea5e444d2839d08 (diff) | |
| download | home-manager-config-41bdeb88009dd232808edee9fc0e4ae94358d8d6.tar.gz home-manager-config-41bdeb88009dd232808edee9fc0e4ae94358d8d6.zip | |
refactor: moving script into modules that makes sense
- instead of collecting all scripts into modules/scripts we are moving
them to modules that makes sense (yazi-file-chooser.sh into yazi)
Diffstat (limited to 'modules/networking/usque/default.nix')
| -rw-r--r-- | modules/networking/usque/default.nix | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/modules/networking/usque/default.nix b/modules/networking/usque/default.nix index b8c25ee..9d04ab7 100644 --- a/modules/networking/usque/default.nix +++ b/modules/networking/usque/default.nix @@ -5,6 +5,24 @@ lib, ... }: +let + inherit ((import ../../lib/script.nix { inherit lib pkgs; })) mkScriptModule; + usqueWarp = mkScriptModule { + scope = [ + "networking" + "usque" + ]; + name = "usque-warp"; + path = ./usque-warp.sh; + description = "Connect/disconnect to Cloudflare WARP via usque MASQUE tunnel"; + deps = [ + config.networking.usque.package + pkgs.bash + ]; + completion.zsh = builtins.readFile ./usque-warp.zsh; + inherit config; + }; +in { options.networking.usque = { enable = lib.mkEnableOption "Enables usque."; @@ -13,9 +31,13 @@ default = pkgs.usque; description = "The usque package to use."; }; - }; + } + // usqueWarp.options.networking.usque; - config = lib.mkIf config.networking.usque.enable { - home.packages = [ config.networking.usque.package ]; - }; + config = lib.mkMerge [ + (lib.mkIf config.networking.usque.enable { + home.packages = [ config.networking.usque.package ]; + }) + usqueWarp.config + ]; } |
