Unverified Commit 314c9128 authored by r-vdp's avatar r-vdp
Browse files

nixos/transmission: replace activationScript by a systemd unit

parent cd986a2a
Loading
Loading
Loading
Loading
+23 −13
Original line number Diff line number Diff line
@@ -357,7 +357,16 @@ in
    # when /home/foo is not owned by cfg.user.
    # Note also that using an ExecStartPre= wouldn't work either
    # because BindPaths= needs these directories before.
    system.activationScripts.transmission-daemon = ''
    systemd.services.transmission-setup = {
      before = [ "transmission.service" ];
      partOf = [ "transmission.service" ];

      serviceConfig = {
        Type = "oneshot";
        RemainAfterExit = true;
      };

      script = ''
        install -d -m 700 -o '${cfg.user}' -g '${cfg.group}' '${cfg.home}/${settingsDir}'
      ''
      + optionalString (cfg.downloadDirPermissions != null) ''
@@ -370,6 +379,7 @@ in
          install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.watch-dir}'
        ''}
      '';
    };

    systemd.services.transmission = {
      description = "Transmission BitTorrent Service";