So I’ll start by admitting that I shot myself in the foot a bit by installing nixos (I’m willing to move to any Linux because that’s what I’m familiar with) on what I hope to make my dedicated NAS computer. I have quite a bit of Linux experience doing normal computer things locally, but damned if networking isn’t a completely different ball game and you have to admit the documentation for this stuff can be a little on the obtuse side!

Long story short I’m looking for a solution I can roll out in just a couple hours for setting up a jellyfin with the *arrs and whatever torrent web UI I don’t care, which has sane defaults, will let me easily manage it remotely, and will definitely pipe all torrent activity through my mullvad VPN. I’ve been using qbittorrent because it lets you define a network interface and if the VPN isn’t available it will just stop. I’d like to ensure this always happens because my ISP is very touchy.

I’ve found a docker with the *arrs and jellyfin but it uses PIA for the VPN and I don’t know how to change that, and I also don’t know how to import my existing library because sonarr keeps misidentifying everything when I try. I know nothing about docker and at this point am too pissed off at it to want to learn either (really I just need a video/document that explains what docker is and does and gets to the point you know? I haven’t had much luck)

Also I’ve never been able to get any kind of file server working except sshfs on this network.

I have it so tantalizingly, obnoxiously close to working how I want, there’s just always something that breaks on me and I’m out of mental energy for this project and I’d like something that works. What do you people do?

If this is the wrong place to post this or there exists a better one, I apologize. Or if you do decide to put up with my essentially vent posting I appreciate it!

  • 2xsaiko@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    11 months ago
    1. Disregard Docker. You’ve got NixOS, you don’t need Docker. Thank god.
    2. Configure the services:
    {config, pkgs, ...}: {
      # Jellyfin
      services.jellyfin.enable = true;
      
      # enable the other *arrs, whichever you want to use
      services.sonarr.enable = true;
    
      # qbittorrent user and service
      users = {
        groups.torrent = {
          # put users that should be allowed to access torrented media
          members = [config.services.jellyfin.user "you"];
        };
    
        users.torrent = {
          isSystemUser = true;
          description = "qbittorrent user";
          group = "torrent";
          createHome = true;
          home = "/var/lib/torrent";
        };
      };
      
      systemd.services.qbittorrent = let
        qbittorrent = pkgs.qbittorrent.override {guiSupport = false;};
      in {
        enable = true;
        description = "qbittorrent daemon";
        documentation = ["man:qbittorrent-nox(1)"];
        wants = ["network-online.target"];
        after = ["network-online.target" "nss-lookup.target"];
        wantedBy = ["multi-user.target"];
        serviceConfig = {
          ExecStart = "${qbittorrent}/bin/qbittorrent-nox";
          User = "torrent";
        };
      };
      
      # VPN configuration
      networking.wg-quick.interfaces = {
        mullvad = {
          # Insert options for Mullvad
          address = [...];
          dns = [...];
          peers = [
            {
              publicKey = "...";
              allowedIPs = ["0.0.0.0/0" "::0/0"];
              endpoint = "...";
            }
          ];
        };
      };
      
      # file server, SMB unfortunately works the best for all the operating systems
      services.samba = {
        enable = true;
        shares = {
          storage = {
            # where do you store your stuff?
            path = "/path/to/linux/ISOs";
            browseable = "yes";
            "read only" = "no";
            "guest ok" = "yes";
            "create mask" = "0644";
            "directory mask" = "0755";
          };
        };
        extraConfig = ''
          workgroup = WORKGROUP
          server string = ${config.networking.hostName}
          netbios name = ${config.networking.hostName}
    
          guest account = nobody
          map to guest = bad user
    
          # No printers
          load printers = no
          printing = bsd
          printcap name = /dev/null
          disable spoolss = yes
          show add printer wizard = no
    
          dos charset = CP850
          unix charset = UTF-8
          unix extensions = yes
          ; mangled names = no
          map archive = no
          map system = no
          map hidden = no
        '';
      };
    }
    

    This is a minimal config that doesn’t set up specific stuff like qbittorrent’s file storage location or network interface, I’d tell you how to do it but I don’t actually have such a setup. This is just copied from what I have/had in my configuration and looking up services on https://search.nixos.org (very useful site if you don’t know about it).