From d4d2f6d51c02b81603cc7e2d46c289711a3bfc28 Mon Sep 17 00:00:00 2001 From: smayzy Date: Mon, 21 Jul 2025 15:42:52 +0200 Subject: [PATCH] mv tor to modules --- hosts/common/common.nix | 1 - modules/nix/vpn/default.nix | 1 + modules/nix/vpn/tor.nix | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 modules/nix/vpn/tor.nix diff --git a/hosts/common/common.nix b/hosts/common/common.nix index cc0facc..bb097c3 100644 --- a/hosts/common/common.nix +++ b/hosts/common/common.nix @@ -18,7 +18,6 @@ environment.systemPackages = with pkgs; [ home-manager - tor mpv ]; diff --git a/modules/nix/vpn/default.nix b/modules/nix/vpn/default.nix index b4eef7c..2822835 100644 --- a/modules/nix/vpn/default.nix +++ b/modules/nix/vpn/default.nix @@ -3,5 +3,6 @@ imports = [ ./mullvad.nix ./wireguard.nix + ./tor.nix ]; } diff --git a/modules/nix/vpn/tor.nix b/modules/nix/vpn/tor.nix new file mode 100644 index 0000000..516e9b5 --- /dev/null +++ b/modules/nix/vpn/tor.nix @@ -0,0 +1,19 @@ +{ lib, config, pkgs, ... }: +let + inherit (lib) mkIf mkOption types; +in +{ + options.smayzy.tor.enable = mkOption { + type = types.bool; + default = false; + description = "tor"; + }; + + config = mkIf config.smayzy.tor.enable { + environment.systemPackages = with pkgs; [ + tor + tor-browser + ]; + services.tor.enable = true; + }; +}