···
security.apparmor.policies."bin.transmission-daemon".profile = ''
362
-
include <tunables/global>
363
-
${pkgs.transmission}/bin/transmission-daemon {
364
-
include <abstractions/base>
365
-
include <abstractions/nameservice>
366
-
include <abstractions/ssl_certs>
367
-
include "${pkgs.apparmorRulesFromClosure
368
-
{ name = "transmission-daemon"; }
369
-
[ pkgs.transmission ]}"
370
-
include <local/bin.transmission-daemon>
362
+
include "${pkgs.transmission.apparmor}/bin.transmission-daemon"
364
+
security.apparmor.includes."local/bin.transmission-daemon" = ''
365
+
r ${config.systemd.services.transmission.environment.CURL_CA_BUNDLE},
372
-
r @{PROC}/sys/kernel/random/uuid,
373
-
r @{PROC}/sys/vm/overcommit_memory,
374
-
r @{PROC}/@{pid}/environ,
375
-
r @{PROC}/@{pid}/mounts,
376
-
rwk /tmp/tr_session_id_*,
377
-
r /run/systemd/resolve/stub-resolv.conf,
367
+
owner rw ${cfg.home}/${settingsDir}/**,
368
+
rw ${cfg.settings.download-dir}/**,
369
+
${optionalString cfg.settings.incomplete-dir-enabled ''
370
+
rw ${cfg.settings.incomplete-dir}/**,
372
+
${optionalString cfg.settings.watch-dir-enabled ''
373
+
rw ${cfg.settings.watch-dir}/**,
376
+
rw ${cfg.settings.download-dir}/**,
377
+
${optionalString cfg.settings.incomplete-dir-enabled ''
378
+
rw ${cfg.settings.incomplete-dir}/**,
380
+
${optionalString cfg.settings.watch-dir-enabled ''
381
+
rw ${cfg.settings.watch-dir}/**,
379
-
r ${pkgs.openssl.out}/etc/**,
380
-
r ${config.systemd.services.transmission.environment.CURL_CA_BUNDLE},
382
-
owner rw ${cfg.home}/${settingsDir}/**,
383
-
rw ${cfg.settings.download-dir}/**,
384
-
${optionalString cfg.settings.incomplete-dir-enabled ''
385
-
rw ${cfg.settings.incomplete-dir}/**,
387
-
${optionalString cfg.settings.watch-dir-enabled ''
388
-
rw ${cfg.settings.watch-dir}/**,
391
-
rw ${cfg.settings.download-dir}/**,
392
-
${optionalString cfg.settings.incomplete-dir-enabled ''
393
-
rw ${cfg.settings.incomplete-dir}/**,
395
-
${optionalString cfg.settings.watch-dir-enabled ''
396
-
rw ${cfg.settings.watch-dir}/**,
400
-
${optionalString (cfg.settings.script-torrent-done-enabled &&
401
-
cfg.settings.script-torrent-done-filename != "") ''
402
-
# Stack transmission_directories profile on top of
403
-
# any existing profile for script-torrent-done-filename
404
-
# FIXME: to be tested as I'm not sure it works well with NoNewPrivileges=
405
-
# https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorStacking#seccomp-and-no_new_privs
406
-
px ${cfg.settings.script-torrent-done-filename} -> &@{dirs},
385
+
${optionalString (cfg.settings.script-torrent-done-enabled &&
386
+
cfg.settings.script-torrent-done-filename != "") ''
387
+
# Stack transmission_directories profile on top of
388
+
# any existing profile for script-torrent-done-filename
389
+
# FIXME: to be tested as I'm not sure it works well with NoNewPrivileges=
390
+
# https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorStacking#seccomp-and-no_new_privs
391
+
px ${cfg.settings.script-torrent-done-filename} -> &@{dirs},
410
-
security.apparmor.includes."local/bin.transmission-daemon" = "";
meta.maintainers = with lib.maintainers; [ julm ];