M nixos-configurations/default.nix => nixos-configurations/default.nix +1 -31
@@ 6,37 6,7 @@
modules = [
genodepkgs.nixosModules.x86_64
genodepkgs.nixosModules.nova
-
- ({ config, lib, pkgs, ... }: {
- genode.boot.storeBackend = "usb";
- genode.gui.consoleLog.enable = true;
- networking.interfaces.eth0.genode.driver = "ipxe";
- services.tor = {
- enable = true;
- client.enable = false;
- extraConfig = ''
- Log [general,net,config,fs]debug stdout
- ''; # MaxMemInQueues 64 MBytes
- relay = {
- enable = true;
- contactInfo = "genodepkgs-junk@spam.works";
- port = 80;
- role = "relay";
- bridgeTransports = [ ];
- };
- };
- systemd.services.tor.genode = {
- enable = true;
- interface = "eth0";
- ramQuota = 1024;
- extraVfs = pkgs.writeText "tor.vfs.dhall" ''
- let VFS = (env:DHALL_GENODE).VFS
-
- in [ VFS.dir "var" [ VFS.dir "lib" [ VFS.leaf "ram" ] ] ]
- '';
- };
- })
-
+ ./tor-relay.nix
];
};
}
A nixos-configurations/tor-relay.nix => nixos-configurations/tor-relay.nix +29 -0
@@ 0,0 1,29 @@
+{ config, lib, pkgs, ... }: {
+ genode.boot.storeBackend = "usb";
+ genode.gui.consoleLog.enable = true;
+ networking.interfaces.eth0.genode.driver = "ipxe";
+ services.tor = {
+ enable = true;
+ client.enable = false;
+ extraConfig = ''
+ Log [general,net,config,fs]debug stdout
+ ''; # MaxMemInQueues 64 MBytes
+ relay = {
+ enable = true;
+ contactInfo = "genodepkgs-junk@spam.works";
+ port = 80;
+ role = "relay";
+ bridgeTransports = [ ];
+ };
+ };
+ systemd.services.tor.genode = {
+ enable = true;
+ interface = "eth0";
+ ramQuota = 1024;
+ extraVfs = pkgs.writeText "tor.vfs.dhall" ''
+ let VFS = (env:DHALL_GENODE).VFS
+
+ in [ VFS.dir "var" [ VFS.dir "lib" [ VFS.leaf "ram" ] ] ]
+ '';
+ };
+}
A tests/tor.nix => tests/tor.nix +34 -0
@@ 0,0 1,34 @@
+{
+ name = "tor";
+ machine = { config, pkgs, ... }: {
+ imports = [ ../nixos-modules/hardware.nix ../nixos-modules/systemd.nix ];
+ hardware.usb.genode.enable = true;
+ services.tor = {
+ enable = true;
+ client.enable = false;
+ extraConfig = ''
+ Log [general,net,config,fs]debug stdout
+ MaxMemInQueues 64 MBytes
+ '';
+ relay = {
+ enable = true;
+ contactInfo = "genodepkgs-junk@spam.works";
+ port = 80;
+ role = "relay";
+ bridgeTransports = [ ];
+ };
+ };
+ systemd.services.tor.genode = {
+ enable = true;
+ interface = "eth1";
+ ramQuota = 96;
+ extraVfs = pkgs.writeText "tor.vfs.dhall" ''
+ let Genode = env:DHALL_GENODE
+
+ let VFS = Genode.VFS
+
+ in [ VFS.dir "var" [ VFS.dir "lib" [ VFS.leaf "ram" ] ] ]
+ '';
+ };
+ };
+}