me like nix
0

Configure Feed

Select the types of activity you want to include in your feed.

Create Transmission media dirs before service start

author
Sean Aye
date (Jun 14, 2026, 10:13 PM -0400) commit d88ddcd4 parent 566bada8 change-id kmuxrwml
+23 -7
+23 -7
modules/media-server.nix
··· 25 25 26 26 systemd.tmpfiles.rules = [ 27 27 "d /mnt/storage2/immich 0750 immich immich -" 28 + ]; 28 29 29 - # Required before transmission.service starts because its sandbox bind-mounts 30 - # these paths. nixarr declares them too, but quote-wrapped tmpfiles paths can 31 - # fail to materialize before the service restart during switch. 32 - "d /mnt/storage1/nixarr/media/torrents 0755 transmission media - -" 33 - "d /mnt/storage1/nixarr/media/torrents/.incomplete 0755 transmission media - -" 34 - "d /mnt/storage1/nixarr/media/torrents/.watch 0755 transmission media - -" 35 - ]; 30 + # transmission.service bind-mounts these paths before ExecStartPre runs, while 31 + # systemd-tmpfiles refuses to create them because /mnt/storage1 is user-owned. 32 + # Create them in a small unsandboxed dependency before Transmission starts. 33 + systemd.services.transmission-media-dirs = { 34 + description = "Create Transmission media directories"; 35 + before = [ "transmission.service" ]; 36 + requiredBy = [ "transmission.service" ]; 37 + serviceConfig = { 38 + Type = "oneshot"; 39 + RemainAfterExit = true; 40 + }; 41 + script = '' 42 + install -d -o transmission -g media -m 0755 \ 43 + /mnt/storage1/nixarr/media/torrents \ 44 + /mnt/storage1/nixarr/media/torrents/.incomplete \ 45 + /mnt/storage1/nixarr/media/torrents/.watch 46 + ''; 47 + }; 48 + systemd.services.transmission = { 49 + requires = [ "transmission-media-dirs.service" ]; 50 + after = [ "transmission-media-dirs.service" ]; 51 + }; 36 52 37 53 # nixarr configures SABnzbd through services.sabnzbd.settings on newer nixpkgs, 38 54 # but NixOS keeps the legacy configFile default when system.stateVersion < 26.05,