From ceacb3ae30b7a4c3e2c70953a0adb6ded06014be Mon Sep 17 00:00:00 2001 From: cnst Date: Sun, 3 Aug 2025 17:19:15 +0200 Subject: [PATCH] remove dead code --- modules/default.nix | 1 - modules/server/pihole/default.nix | 84 ---------------------- modules/server/qbittorrent/default.nix | 99 -------------------------- 3 files changed, 184 deletions(-) delete mode 100644 modules/server/pihole/default.nix delete mode 100644 modules/server/qbittorrent/default.nix diff --git a/modules/default.nix b/modules/default.nix index 3bd787e3..46565e19 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -64,7 +64,6 @@ ./nixos/hardware/network ./nixos/programs/android - # ./nixos/programs/anyrun ./nixos/programs/beekeeper ./nixos/programs/blender ./nixos/programs/corectrl diff --git a/modules/server/pihole/default.nix b/modules/server/pihole/default.nix deleted file mode 100644 index 99ba4100..00000000 --- a/modules/server/pihole/default.nix +++ /dev/null @@ -1,84 +0,0 @@ -{ - config, - lib, - ... -}: let - unit = "pihole"; - srv = config.server; - cfg = config.server.${unit}; -in { - options.server.${unit} = { - enable = lib.mkEnableOption { - description = "Enable ${unit}"; - }; - url = lib.mkOption { - type = lib.types.str; - default = "${unit}.${srv.domain}"; - }; - homepage.name = lib.mkOption { - type = lib.types.str; - default = "PiHole"; - }; - homepage.description = lib.mkOption { - type = lib.types.str; - default = "Adblocking and DNS service"; - }; - homepage.icon = lib.mkOption { - type = lib.types.str; - default = "pi-hole.svg"; - }; - homepage.category = lib.mkOption { - type = lib.types.str; - default = "Services"; - }; - }; - config = lib.mkIf cfg.enable { - networking.firewall = { - allowedTCPPorts = [53 5335]; - allowedUDPPorts = [53 5335]; - }; - - services.unbound.settings.server = { - access-control = ["10.88.0.0/24 allow"]; - port = "5335"; - }; - - virtualisation.oci-containers = { - backend = "podman"; - containers.pihole = { - autoStart = true; - image = "pihole/pihole:latest"; - volumes = [ - "/var/lib/pihole:/etc/pihole/" - "/var/lib/dnsmasq.d:/etc/dnsmasq.d/" - ]; - environment = { - TZ = "Europe/Stockholm"; - CUSTOM_CACHE_SIZE = "0"; - # PIHOLE_DNS_ = "10.88.0.1#5335"; - # DNSSEC = "false"; - # REV_SERVER = "true"; - WEBTHEME = "default-darker"; - }; - environmentFiles = [config.age.secrets.pihole.path]; - ports = [ - "53:53/tcp" - "53:53/udp" - "8053:80/tcp" - ]; - extraOptions = [ - "--cap-add=NET_ADMIN" - "--cap-add=SYS_NICE" - "--cap-add=SYS_TIME" - ]; - }; - }; - - services.caddy.virtualHosts."${cfg.url}" = { - useACMEHost = srv.domain; - extraConfig = '' - reverse_proxy http://127.0.0.1:8053 - ''; - }; - }; -} diff --git a/modules/server/qbittorrent/default.nix b/modules/server/qbittorrent/default.nix deleted file mode 100644 index afd68109..00000000 --- a/modules/server/qbittorrent/default.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.server.qbittorrent; -in { - options.server.qbittorrent = { - enable = lib.mkEnableOption "Enable qBittorrent"; - url = lib.mkOption { - type = lib.types.str; - default = "qbt.${config.server.domain}"; - }; - port = lib.mkOption { - type = lib.types.int; - default = 8080; - description = "The port to host qBittorrent on."; - }; - homepage.name = lib.mkOption { - type = lib.types.str; - default = "qBittorrent"; - }; - homepage.description = lib.mkOption { - type = lib.types.str; - default = "Torrent client"; - }; - homepage.icon = lib.mkOption { - type = lib.types.str; - default = "qbittorrent.svg"; - }; - homepage.category = lib.mkOption { - type = lib.types.str; - default = "Downloads"; - }; - }; - - config = lib.mkIf cfg.enable { - services.caddy.virtualHosts."${cfg.url}" = { - useACMEHost = config.server.domain; - extraConfig = '' - reverse_proxy http://127.0.0.1:${toString cfg.port} - ''; - }; - - virtualisation.podman.enable = true; - - virtualisation.oci-containers.containers = { - qbittorrent = { - image = "ghcr.io/hotio/qbittorrent:latest"; - autoStart = true; - dependsOn = ["gluetun"]; - ports = [ - "8080:8080" - "58846:58846" - ]; - extraOptions = [ - "--network=container:gluetun" - ]; - volumes = [ - "/var/lib/qbittorrent:/config:rw" - "/share/downloads:/downloads:rw" - ]; - environmentFiles = [ - config.age.secrets.gluetunEnv.path - ]; - environment = { - PUID = "994"; - PGID = "993"; - TZ = "Europe/Stockholm"; - WEBUI_PORT = "${builtins.toString cfg.port}"; - }; - }; - - gluetun = { - image = "qmcgaw/gluetun"; - ports = [ - "8388:8388" - "58846:58846" - "8080:8080" - ]; - devices = ["/dev/net/tun:/dev/net/tun"]; - autoStart = true; - extraOptions = [ - "--cap-add=NET_ADMIN" - ]; - volumes = ["/var:/gluetun"]; - environmentFiles = [ - config.age.secrets.gluetunEnv.path - ]; - environment = { - DEV_MODE = "false"; - VPN_SERVICE_PROVIDER = "mullvad"; - VPN_TYPE = "wireguard"; - SERVER_CITIES = "Stockholm"; - }; - }; - }; - }; -}