Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { pkgs, lib, ... }:
- let
- genTransmission = index:
- let
- name = "transmission" + toString index;
- in
- lib.nameValuePair name {
- autoStart = true;
- forwardPorts = [
- { containerPort = 9091; hostPort = 9091 + index; protocol = "tcp"; }
- { containerPort = 51413; hostPort = 51413 + index; protocol = "tcp"; }
- { containerPort = 51413; hostPort = 51413 + index; protocol = "udp"; }
- ];
- bindMounts = {
- "/transmission/Downloads" = { hostPath = "/stereolith/crap/transmission/Downloads"; isReadOnly = false; };
- "/var/lib/transmission/.config/transmission-daemon/resume" = { hostPath = "/stereolith/crap/transmission/state/" + name + "/resume"; isReadOnly = false; };
- "/var/lib/transmission/.config/transmission-daemon/torrents" = { hostPath = "/stereolith/crap/transmission/state/" + name + "/torrents"; isReadOnly = false; };
- };
- config = {
- nixpkgs.overlays = [ (self: super: {
- transmission = super.transmission.overrideAttrs (old: {
- buildInputs = with pkgs; [ autoconf automake115x systemd ] ++ old.buildInputs;
- postPatch = old.postPatch + ''
- substituteInPlace ./configure.ac \
- --replace "libsystemd-daemon" "libsystemd" \
- --replace "test ! -d /Developer/SDKs/MacOSX10.5.sdk" "false"
- '';
- patches = builtins.map super.fetchpatch [
- { url = "https://raw.githubusercontent.com/WeebDataHoarder/Transmission-AB/master/transmission-Patches/0001-fdlimit-backported-from-3.0.patch";
- sha256 = "0y6cmybj8yy08wqay1wl461vpapap9hzn3n7r702kpk5cwjfggyy";
- }
- { url = "https://raw.githubusercontent.com/WeebDataHoarder/Transmission-AB/master/transmission-Patches/0002-resume-filename-back-to-hash-backported-from-3.0.patch";
- sha256 = "1fd62q0a0xdjbirkvs232dpxb3qy55vy7fpx6k2w44zpsp7mgaz0";
- }
- { url = "https://raw.githubusercontent.com/WeebDataHoarder/Transmission-AB/master/transmission-Patches/0003-semiseq.patch";
- sha256 = "0r7fxakmw19zps046s2c1idhwc07zh1azdyw3l6n57p4q5lv6vyw";
- }
- ];
- });
- }) ];
- services.transmission = {
- enable = true;
- settings = {
- rpc-whitelist-enabled = false;
- download-dir = "/transmission/Downloads";
- incomplete-dir = "/transmission/Downloads";
- };
- };
- systemd.services.transmission.serviceConfig.LimitNOFILE = 524288;
- };
- };
- in
- {
- containers = {
- kms = {
- autoStart = true;
- forwardPorts = [
- { containerPort = 1688; hostPort = 1688; protocol = "tcp"; }
- ];
- extraFlags = [ "-U" ];
- config = {
- services.pykms.enable = true;
- };
- };
- } // (lib.listToAttrs (map genTransmission (lib.range 0 10)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement