From eba8b48ed06b55aefc7ba80a6102cfbe77153897 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 25 Dec 2025 18:47:09 +0100 Subject: refactor: rename torrent module to qbittorrent --- nixos/hosts/ev/default.nix | 6 +++--- nixos/hosts/ev/qbittorrent.nix | 43 ++++++++++++++++++++++++++++++++++++++++++ nixos/hosts/ev/torrent.nix | 43 ------------------------------------------ 3 files changed, 46 insertions(+), 46 deletions(-) create mode 100644 nixos/hosts/ev/qbittorrent.nix delete mode 100644 nixos/hosts/ev/torrent.nix (limited to 'nixos/hosts/ev') diff --git a/nixos/hosts/ev/default.nix b/nixos/hosts/ev/default.nix index 252e5c8..0723b8d 100644 --- a/nixos/hosts/ev/default.nix +++ b/nixos/hosts/ev/default.nix @@ -24,8 +24,8 @@ in ./kodi.nix ./miniflux.nix ./navidrome.nix - ./torrent.nix ./hosehawk.nix + ./qbittorrent.nix ]; # enable unlocking full disk encryption via SSH @@ -49,8 +49,8 @@ in networking.interfaces.enp3s0.useDHCP = true; home-automation.zigbee2mqttPort = ports.zigbee2mqtt; - torrent.qbittorrentWebUiPort = ports.qbittorrent; - torrent.networkNamespace = "se"; + qbittorrent.webUiPort = ports.qbittorrent; + qbittorrent.networkNamespace = "se"; monitoring.alloyUiPort = ports.grafanaAlloy; monitoring.lokiPort = ports.grafanaLoki; monitoring.prometheusPort = ports.prometheus; diff --git a/nixos/hosts/ev/qbittorrent.nix b/nixos/hosts/ev/qbittorrent.nix new file mode 100644 index 0000000..697533b --- /dev/null +++ b/nixos/hosts/ev/qbittorrent.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +let + helpers = import { inherit config lib pkgs; }; + cfg = config.qbittorrent; +in +{ + options.qbittorrent = { + webUiPort = lib.mkOption { + type = lib.types.int; + }; + networkNamespace = lib.mkOption { + type = lib.types.str; + }; + }; + + config = { + environment.systemPackages = [pkgs.qbittorrent-nox]; + + users.extraUsers.qbittorrent = { + isSystemUser = true; + group = "qbittorrent"; + home = "/var/lib/qbittorrent"; + createHome = true; + }; + users.groups.qbittorrent = {}; + + systemd = { + packages = [pkgs.qbittorrent-nox]; + services."qbittorrent" = helpers.joinWgNamespace cfg.networkNamespace { + enable = true; + path = [pkgs.qbittorrent-nox]; + serviceConfig = { + ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox --webui-port=${toString cfg.webUiPort}"; + User = "qbittorrent"; + }; + wantedBy = ["multi-user.target"]; + }; + + services.qbittorrent-webui-proxy = helpers.mkPortProxy "qbittorrent" cfg.networkNamespace cfg.webUiPort; + }; + }; +} diff --git a/nixos/hosts/ev/torrent.nix b/nixos/hosts/ev/torrent.nix deleted file mode 100644 index a09c507..0000000 --- a/nixos/hosts/ev/torrent.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - helpers = import { inherit config lib pkgs; }; - cfg = config.torrent; -in -{ - options.torrent = { - qbittorrentWebUiPort = lib.mkOption { - type = lib.types.int; - }; - networkNamespace = lib.mkOption { - type = lib.types.str; - }; - }; - - config = { - environment.systemPackages = [pkgs.qbittorrent-nox]; - - users.extraUsers.qbittorrent = { - isSystemUser = true; - group = "qbittorrent"; - home = "/var/lib/qbittorrent"; - createHome = true; - }; - users.groups.qbittorrent = {}; - - systemd = { - packages = [pkgs.qbittorrent-nox]; - services."qbittorrent" = helpers.joinWgNamespace cfg.networkNamespace { - enable = true; - path = [pkgs.qbittorrent-nox]; - serviceConfig = { - ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox --webui-port=${toString cfg.qbittorrentWebUiPort}"; - User = "qbittorrent"; - }; - wantedBy = ["multi-user.target"]; - }; - - services.qbittorrent-webui-proxy = helpers.mkPortProxy "qbittorrent" cfg.networkNamespace cfg.qbittorrentWebUiPort; - }; - }; -} -- cgit v1.3.1