2
0
Fork 0

fixup nixosConfigurations

This commit is contained in:
Emery Hemingway 2020-12-20 17:06:38 +01:00
parent 57249d98e5
commit 221fcea79d
4 changed files with 61 additions and 1 deletions

View File

@ -132,6 +132,13 @@
# Modules for composing Genode and NixOS
import ./nixos-modules { flake = self; };
nixosConfigurations =
# Demo NixOS configurations
import ./nixos-configurations {
inherit nixpkgs;
genodepkgs = self;
};
checks =
# Checks for continous testing
let tests = import ./tests;

View File

@ -0,0 +1,12 @@
{ nixpkgs, genodepkgs }:
{
torDemo = nixpkgs.lib.nixosSystem {
system = "x86_64-genode";
modules = [
genodepkgs.nixosModules.x86_64
genodepkgs.nixosModules.nova
(import ./tor-relay.nix)
];
};
}

View File

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
{
networking.interfaces.eth0 = {
genode.driver = "virtio";
useDHCP = true;
};
services.tor = {
enable = true;
client.enable = false;
extraConfig = ''
Log [general,net,config,fs]debug stdout
'';
relay = {
enable = true;
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" ] ] ]
'';
};
}

View File

@ -6,7 +6,13 @@ let
in {
x86_64 = {
imports = [ baseModules ];
imports = [
./genode-core.nix
./genode-init.nix
./hardware.nix
./qemu-vm.nix
./systemd.nix
];
nixpkgs = rec {
localSystem = "x86_64-linux";
crossSystem = "x86_64-genode";