Transmission: Difference between revisions

imported>Jmarmstrong1207
Change to outdated tag
imported>Jmarmstrong1207
Modify service configuration section to be easier to understand for newer users. Remove section about losing settings at relaunch, because I believe that has been fixed. It works on my machine
Line 7: Line 7:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
environment.systemPackages = with pkgs; [ transmission_4-gtk ];
environment.systemPackages = with pkgs; [ transmission_4-gtk ];
</syntaxHighlight>
If you want to configure the settings declaratively with within configuration.nix, you will have to instead install transmission-qt or transmission-gtk. Do note that this is using version 3.0.0 instead of version 4.
<syntaxHighlight lang=nix>
environment.systemPackages = with pkgs; [ transmission-qt ];
</syntaxHighlight>
<syntaxHighlight lang=nix>
environment.systemPackages = with pkgs; [ transmission-gtk ];
</syntaxHighlight>
</syntaxHighlight>


== Service configuration ==
== Service configuration ==
{{outdated | This section was created in 2017 and this workaround may not be needed anymore for changing settings. This will stay until final confirmation occurs.}}
You can declaratively change the settings via Nix by modifying <code>services.transmission.settings</code>. [https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=transmission.settings View the documentation for more info]. Like the previous section has said before, you'll have to use the nixpkgs transmission-gtk or transmission-qt for this to work.
 
Changes to the configuration in the interface will not persist when the application is re-launched. <code>services.transmission.settings</code> is reset each time the service restarts.  


<blockquote>
Example:
Attribute set whos[e] fields overwrites fields in settings.json (each
<syntaxHighlight lang=nix>
time the service starts). String values must be quoted, integer and
services.transmission.settings = {
boolean values must not.
  download-dir = "${config.services.transmission.home}/Downloads";
</blockquote>
};
<cite>[https://github.com/NixOS/nixpkgs/blob/dd705fb45fd17c078522dedb76ee710ed4d3af4b/nixos/modules/services/torrent/transmission.nix#L64:L71 <nixpkgs>/nixos/modules/services/torrent/transmission.nix]</cite>


To persist changes, edit them, look at the <code>[services.transmission.home]/.config/transmission-daemon/settings.json</code> file generated for the setting keys and their values, and save them to <code>services.transmission.settings</code>
</syntaxHighlight>


=== Password-protected RPC ===
=== Password-protected RPC ===