this post was submitted on 14 Mar 2025
6 points (100.0% liked)
Nix / NixOS
2028 readers
4 users here now
Main links
Videos
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
As far as I can see you don't define any way to start Tor in nix but that is how nix normally passes along the tor config.
ExecStart=/nix/store/<hash1>-tor-0.4.8.14/bin/tor -f /nix/store/<hash2>-torrc
ExecStart=${pkgs.tor}/bin/tor -f ${localTorrcDefinition}
You could define a file in etc that is your torrc, then point your service manager to use that as the -f argument for Tor.
Another way would be to create a small derivation that copies the default tor derivation, overwrites the etc folder and then use that as your system Tor. (See runCommand)
I haven’t made it a service yet (it was going to be my next step), for now I was just starting it manually ! Your suggestion works (probably, not tested yet), but I was looking for a way to have the config loaded automatically even when running the
tor
command directly in a terminal (without any arguments)