sigil/nixos-modules/services/tor.nix

28 lines
789 B
Nix
Raw Normal View History

2021-04-10 17:11:43 +02:00
{ config, lib, pkgs, ... }:
let toDhall = lib.generators.toDhall { };
2021-04-10 17:11:43 +02:00
in {
config = lib.mkIf config.services.tor.enable {
genode.init.children.tor = let
args = lib.strings.splitString " "
config.systemd.services.tor.serviceConfig.ExecStart;
tor' = lib.getEris' "bin" pkgs.tor "tor";
2021-04-12 21:08:24 +02:00
lwip' = lib.getEris "lib" pkgs.genodePackages.vfs_lwip;
pipe' = lib.getEris "lib" pkgs.genodePackages.vfs_pipe;
2021-04-10 17:11:43 +02:00
in {
binary = builtins.head args;
package = pkgs.tor;
2021-04-12 21:08:24 +02:00
extraErisInputs = [ tor' lwip' pipe' ];
configFile = pkgs.writeText "tor.dhall" "${./tor.dhall} ${toDhall args} ${
toDhall {
lwip = lwip'.cap;
pipe = pipe'.cap;
}
}";
uplinks.uplink.driver = "ipxe";
2021-04-10 17:11:43 +02:00
};
};
}