lol

nixos/tor: use RuntimeDirectory, StateDirectory (#39083)

authored by

Robert Schütz and committed by
GitHub
5bd12c69 f00221d0

+4 -6
+4 -6
nixos/modules/services/security/tor.nix
··· 703 703 after = [ "network.target" ]; 704 704 restartTriggers = [ torRcFile ]; 705 705 706 - # Translated from the upstream contrib/dist/tor.service.in 707 - preStart = '' 708 - install -o tor -g tor -d ${torDirectory}/onion ${torRunDirectory} 709 - ${pkgs.tor}/bin/tor -f ${torRcFile} --verify-config 710 - ''; 711 - 712 706 serviceConfig = 713 707 { Type = "simple"; 708 + # Translated from the upstream contrib/dist/tor.service.in 709 + ExecStartPre = "${pkgs.tor}/bin/tor -f ${torRcFile} --verify-config"; 714 710 ExecStart = "${pkgs.tor}/bin/tor -f ${torRcFile} --RunAsDaemon 0"; 715 711 ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; 716 712 KillSignal = "SIGINT"; ··· 725 721 # DeviceAllow /dev/urandom r 726 722 # .. but we can't specify DeviceAllow multiple times. 'closed' 727 723 # is close enough. 724 + RuntimeDirectory = "tor"; 725 + StateDirectory = [ "tor" "tor/onion" ]; 728 726 PrivateTmp = "yes"; 729 727 DevicePolicy = "closed"; 730 728 InaccessibleDirectories = "/home";