From 58a84c6727dbe95ab32e3a7802a9d7fd30b408e9 Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 19 Oct 2024 15:45:18 +0300 Subject: [PATCH 1/3] bitmagnet: pin Go 1.22 --- pkgs/by-name/bi/bitmagnet/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/bi/bitmagnet/package.nix b/pkgs/by-name/bi/bitmagnet/package.nix index dfeb7b31e86c..565d53048851 100644 --- a/pkgs/by-name/bi/bitmagnet/package.nix +++ b/pkgs/by-name/bi/bitmagnet/package.nix @@ -1,10 +1,10 @@ { lib -, buildGoModule +, buildGo122Module # builds, but does not start on 1.23 , fetchFromGitHub , nix-update-script }: -buildGoModule rec { +buildGo122Module rec { pname = "bitmagnet"; version = "0.9.5"; From 3a4fc1a18321efe1e8e6546f219aa162b407cdcd Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 19 Oct 2024 15:50:18 +0300 Subject: [PATCH 2/3] nixos: add bitmagnet module to the list Fixes #337310 --- nixos/modules/module-list.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6ac03cca94e9..6a1fd5a45dc2 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1359,6 +1359,7 @@ ./services/system/uptimed.nix ./services/system/userborn.nix ./services/system/zram-generator.nix + ./services/torrent/bitmagnet.nix ./services/torrent/deluge.nix ./services/torrent/flexget.nix ./services/torrent/flood.nix From fcc185b9863251246b8f7cbe819fce4279e7241a Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 19 Oct 2024 15:55:15 +0300 Subject: [PATCH 3/3] nixos/bitmagnet: add help text for the options, fix typo --- nixos/modules/services/torrent/bitmagnet.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/torrent/bitmagnet.nix b/nixos/modules/services/torrent/bitmagnet.nix index 8d96c0b430a9..c0929b69f451 100644 --- a/nixos/modules/services/torrent/bitmagnet.nix +++ b/nixos/modules/services/torrent/bitmagnet.nix @@ -40,48 +40,57 @@ in options = { http_server = mkOption { default = { }; + description = "HTTP server settings"; type = submodule { inherit freeformType; options = { port = mkOption { type = str; default = ":3333"; + description = "HTTP server listen port"; }; }; }; }; dht_server = mkOption { default = { }; + description = "DHT server settings"; type = submodule { inherit freeformType; options = { port = mkOption { type = port; default = 3334; + description = "DHT listen port"; }; }; }; }; postgres = mkOption { default = { }; + description = "PostgreSQL database configuration"; type = submodule { inherit freeformType; options = { host = mkOption { type = str; default = ""; + description = "Address, hostname or Unix socket path of the database server"; }; name = mkOption { type = str; default = "bitmagnet"; + description = "Database name to connect to"; }; user = mkOption { type = str; default = ""; + description = "User to connect as"; }; password = mkOption { type = str; default = ""; + description = "Password for database user"; }; }; }; @@ -163,8 +172,8 @@ in }; users.groups = mkIf (cfg.group == "bitmagnet") { bitmagnet = { }; }; networking.firewall = mkIf cfg.openFirewall { - allowedTCPPorts = [ cfg.dht_server.port ]; - allowedUDPPorts = [ cfg.dht_server.port ]; + allowedTCPPorts = [ cfg.settings.dht_server.port ]; + allowedUDPPorts = [ cfg.settings.dht_server.port ]; }; services.postgresql = mkIf cfg.useLocalPostgresDB { enable = true;