From 0038dbf8ce5dfdf39276da79f44d98e0ebb6742f Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 30 Sep 2024 09:37:25 +0100 Subject: [PATCH] add transmission-daemon --- .../optional/desktop/dwm/music_player.nix | 1 - home/common/optional/transmission.nix | 53 +++++++++++++++++++ home/semita.nix | 1 + 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 home/common/optional/transmission.nix diff --git a/home/common/optional/desktop/dwm/music_player.nix b/home/common/optional/desktop/dwm/music_player.nix index 6685b1c..a4c8adc 100644 --- a/home/common/optional/desktop/dwm/music_player.nix +++ b/home/common/optional/desktop/dwm/music_player.nix @@ -39,7 +39,6 @@ format "44100:16:2" } - bind_to_address "127.0.0.1" ''; musicDirectory = "~/mus/music_data"; }; diff --git a/home/common/optional/transmission.nix b/home/common/optional/transmission.nix new file mode 100644 index 0000000..58af9b6 --- /dev/null +++ b/home/common/optional/transmission.nix @@ -0,0 +1,53 @@ +{ + config, + pkgs, + ... +}: let +in { + systemd.user.services.transmission-daemon = { + Unit = { + Description = "Transmission Bittorrent Daemon"; + Wants = "network-online.target"; + After = "network-online.target"; + Documentation = "man:transmission-daemon(1)"; + }; + Install = { + WantedBy = ["multi-user.target"]; + }; + Service = { + User = "transmission"; + Type = "notify"; + ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --log-level=error"; + ExecReload = "${pkgs.coreutils}/bin/kill -s HUP $MAINPID"; + CapabilityBoundingSet = ""; + DevicePolicy = "closed"; + KeyringMode = "private"; + LockPersonality = "true"; + NoNewPrivileges = "true"; + MemoryDenyWriteExecute = "true"; + PrivateTmp = "true"; + PrivateDevices = "true"; + ProtectClock = "true"; + ProtectKernelLogs = "true"; + ProtectControlGroups = "true"; + ProtectKernelModules = "true"; + ProtectSystem = "true"; + ProtectHostname = "true"; + ProtectKernelTunables = "true"; + ProtectProc = "invisible"; + RestrictNamespaces = "true"; + RestrictSUIDSGID = "true"; + RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6"; + RestrictRealtime = "true"; + SystemCallFilter = "@system - service"; + SystemCallArchitectures = "native"; + SystemCallErrorNumber = "EPERM"; + }; + }; + # home.file.".config/transmission-daemon/settings.json" = { + # recursive = true; + # text = '' + # + # ''; + # }; +} diff --git a/home/semita.nix b/home/semita.nix index a5e6bad..a13b298 100644 --- a/home/semita.nix +++ b/home/semita.nix @@ -17,6 +17,7 @@ ./common/optional/desktop/common/themes/standard-dark.nix ./common/optional/notes.nix ./common/optional/yazi.nix + ./common/optional/transmission.nix ]; colorScheme = {