Working on cross-seed and updated the thanks
This commit is contained in:
@@ -238,8 +238,8 @@ you. However, this also means that you don't have to give _any_ personal data.
|
|||||||
## Thanks
|
## Thanks
|
||||||
|
|
||||||
A big thanks to [Maroka-chan](https://github.com/Maroka-chan) for the heavy
|
A big thanks to [Maroka-chan](https://github.com/Maroka-chan) for the heavy
|
||||||
lifting on the VPN-submodule, that was integral to making this project
|
lifting on the [VPN-submodule](https://github.com/Maroka-chan/VPN-Confinement),
|
||||||
possible.
|
that was integral to making this project possible.
|
||||||
|
|
||||||
I would also like to thank [Lasse](https://github.com/lassebomh) for helping
|
I would also like to thank [Lasse](https://github.com/lassebomh) for helping
|
||||||
out with the website.
|
out with the website.
|
||||||
|
|||||||
+4
-4
@@ -37,10 +37,10 @@ in
|
|||||||
|
|
||||||
pandoc \
|
pandoc \
|
||||||
--standalone \
|
--standalone \
|
||||||
--highlight-style docs/pandoc/gruvbox.theme \
|
|
||||||
--metadata title="Nixarr - Option Documentation" \
|
--metadata title="Nixarr - Option Documentation" \
|
||||||
--template docs/pandoc/template.html \
|
|
||||||
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
|
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
|
||||||
|
--highlight-style docs/pandoc/gruvbox.theme \
|
||||||
|
--template docs/pandoc/template.html \
|
||||||
--css docs/pandoc/style.css \
|
--css docs/pandoc/style.css \
|
||||||
--lua-filter docs/pandoc/lua/anchor-links.lua \
|
--lua-filter docs/pandoc/lua/anchor-links.lua \
|
||||||
--lua-filter docs/pandoc/lua/code-default-to-nix.lua \
|
--lua-filter docs/pandoc/lua/code-default-to-nix.lua \
|
||||||
@@ -56,11 +56,11 @@ in
|
|||||||
"$tmpdir"/nixos.md
|
"$tmpdir"/nixos.md
|
||||||
|
|
||||||
pandoc \
|
pandoc \
|
||||||
|
--metadata title="Nixarr" \
|
||||||
|
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
|
||||||
--standalone \
|
--standalone \
|
||||||
--highlight-style docs/pandoc/gruvbox.theme \
|
--highlight-style docs/pandoc/gruvbox.theme \
|
||||||
--template docs/pandoc/template.html \
|
--template docs/pandoc/template.html \
|
||||||
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
|
|
||||||
--metadata title="Nixarr" \
|
|
||||||
--css docs/pandoc/style.css \
|
--css docs/pandoc/style.css \
|
||||||
-V lang=en \
|
-V lang=en \
|
||||||
-V --mathjax \
|
-V --mathjax \
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.util-nixarr.services.prowlarr;
|
||||||
|
#settingsFormat = pkgs.formats.json {};
|
||||||
|
#settingsFile = settingsFormat.generate "settings.json" cfg.settings;
|
||||||
|
cross-seedPkg = import ../../../pkgs/cross-seed { inherit (pkgs) stdenv lib fetchFromGitHub; };
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
util-nixarr.services.prowlarr = {
|
||||||
|
enable = mkEnableOption "cross-seed";
|
||||||
|
|
||||||
|
configFile = mkOption {
|
||||||
|
type = with types; nullOr path;
|
||||||
|
default = null;
|
||||||
|
example = "/var/lib/secrets/cross-seed/settings.js";
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = "/var/lib/cross-seed";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "cross-seed";
|
||||||
|
description = "User account under which cross-seed runs.";
|
||||||
|
};
|
||||||
|
|
||||||
|
group = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "cross-seed";
|
||||||
|
description = "Group under which cross-seed runs.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services.prowlarr = {
|
||||||
|
description = "cross-seed";
|
||||||
|
after = ["network.target"];
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
|
||||||
|
environment.CONFIG_DIR = cfg.dataDir;
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStartPre = [("+" + pkgs.writeShellScript "transmission-prestart" ''
|
||||||
|
mv ${cfg.configFile} ${cfg.dataDir}
|
||||||
|
'')];
|
||||||
|
Type = "simple";
|
||||||
|
User = cfg.user;
|
||||||
|
Group = cfg.group;
|
||||||
|
ExecStart = "${getExe cross-seedPkg} daemon";
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users = mkIf (cfg.user == "cross-seed") {
|
||||||
|
cross-seed = {
|
||||||
|
group = cfg.group;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups = mkIf (cfg.group == "cross-seed") {};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -41,18 +41,29 @@ in {
|
|||||||
|
|
||||||
flood.enable = mkEnableOption "the flood web-UI for the transmission web-UI.";
|
flood.enable = mkEnableOption "the flood web-UI for the transmission web-UI.";
|
||||||
|
|
||||||
privateTrackers = mkOption {
|
privateTrackers = {
|
||||||
type = types.bool;
|
disableDhtPex = mkOption {
|
||||||
default = false;
|
type = types.bool;
|
||||||
description = ''
|
default = false;
|
||||||
Disable pex and dht, which is required for some private trackers.
|
description = ''
|
||||||
|
Disable pex and dht, which is required for some private trackers.
|
||||||
|
|
||||||
You don't want to enable this unless a private tracker requires you
|
You don't want to enable this unless a private tracker requires you
|
||||||
to, and some don't. All torrents from private trackers are set as
|
to, and some don't. All torrents from private trackers are set as
|
||||||
"private", and this automatically disables dht and pex for that torrent,
|
"private", and this automatically disables dht and pex for that torrent,
|
||||||
so it shouldn't even be a necessary rule to have, but I don't make
|
so it shouldn't even be a necessary rule to have, but I don't make
|
||||||
their rules ¯\\_(ツ)_/¯.
|
their rules ¯\\_(ツ)_/¯.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
cross-seed = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable the cross-seed service.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
messageLevel = mkOption {
|
messageLevel = mkOption {
|
||||||
@@ -94,6 +105,10 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./cross-seed
|
||||||
|
];
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
@@ -103,6 +118,12 @@ in {
|
|||||||
nixarr.vpn.enable option to be set, but it was not.
|
nixarr.vpn.enable option to be set, but it was not.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
assertion = cfg.privateTrackers.cross-seed.enable -> nixarr.prowlarr.enable;
|
||||||
|
message = ''
|
||||||
|
TODO: todo
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
@@ -150,7 +171,6 @@ in {
|
|||||||
anti-brute-force-enabled = true;
|
anti-brute-force-enabled = true;
|
||||||
anti-brute-force-threshold = 10;
|
anti-brute-force-threshold = 10;
|
||||||
|
|
||||||
# 0 = None, 1 = Critical, 2 = Error, 3 = Warn, 4 = Info, 5 = Debug, 6 = Trace
|
|
||||||
message-level =
|
message-level =
|
||||||
if cfg.messageLevel == "none"
|
if cfg.messageLevel == "none"
|
||||||
then 0
|
then 0
|
||||||
@@ -171,6 +191,13 @@ in {
|
|||||||
// cfg.extraConfig;
|
// cfg.extraConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.cross-seed = mkIf cfg.cross-seed.enable {
|
||||||
|
enable = true;
|
||||||
|
group = "media";
|
||||||
|
dataDir = cfg.privateTrackers.cross-seed.dataDir;
|
||||||
|
configFile = cfg.privateTrackers.cross-seed.configFile;
|
||||||
|
};
|
||||||
|
|
||||||
util-nixarr.vpnnamespace = mkIf cfg.vpn.enable {
|
util-nixarr.vpnnamespace = mkIf cfg.vpn.enable {
|
||||||
portMappings = [
|
portMappings = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.util-nixarr.services.prowlarr;
|
||||||
|
settingsFormat = pkgs.formats.json {};
|
||||||
|
settingsFile = settingsFormat.generate "settings.json" cfg.settings;
|
||||||
|
cross-seedPkg = import ../../../pkgs/cross-seed { inherit (pkgs) stdenv lib fetchFromGitHub; };
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
util-nixarr.services.prowlarr = {
|
||||||
|
enable = mkEnableOption "cross-seed";
|
||||||
|
|
||||||
|
configFile = mkOption {
|
||||||
|
type = with types; nullOr path;
|
||||||
|
default = null;
|
||||||
|
example = "/var/lib/secrets/cross-seed/settings.json";
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = "/var/lib/cross-seed";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "cross-seed";
|
||||||
|
description = "User account under which cross-seed runs.";
|
||||||
|
};
|
||||||
|
|
||||||
|
group = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "cross-seed";
|
||||||
|
description = "Group under which cross-seed runs.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services.prowlarr = {
|
||||||
|
description = "cross-seed";
|
||||||
|
after = ["network.target"];
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
|
||||||
|
environment.CONFIG_DIR = cfg.dataDir;
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStartPre = [("+" + pkgs.writeShellScript "transmission-prestart" ''
|
||||||
|
mv ${cfg.configFile} ${cfg.dataDir}
|
||||||
|
'')];
|
||||||
|
Type = "simple";
|
||||||
|
User = cfg.user;
|
||||||
|
Group = cfg.group;
|
||||||
|
ExecStart = "${getExe cross-seedPkg} daemon";
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users = mkIf (cfg.user == "cross-seed") {
|
||||||
|
cross-seed = {
|
||||||
|
group = cfg.group;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups = mkIf (cfg.group == "cross-seed") {};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user