aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-16 23:24:11 +0000
committertv <tv@krebsco.de>2026-11-17 00:25:48 +0100
commit2e77e4ec786c6c7574b484b94b372dfcce23fa21 (patch)
tree0beaa9064d163a9075e96c3026a24370307e0ec9
parentaaaeb67ba067b05a6685518ce5d75e92e1de0027 (diff)
move the host module to modules/host
egress.lua goes along. The host now imports it as (import .../modules/host { user = ...; }).
-rw-r--r--modules/host/default.nix (renamed from host.nix)2
-rw-r--r--modules/host/egress.lua (renamed from egress.lua)2
-rw-r--r--pkgs/run-firecracker-vm/default.nix10
3 files changed, 7 insertions, 7 deletions
diff --git a/host.nix b/modules/host/default.nix
index cc9b4ea..37f3e83 100644
--- a/host.nix
+++ b/modules/host/default.nix
@@ -17,7 +17,7 @@
# help); they apply to the next connection.
#
# usage (in the host's configuration.nix):
-# imports = [ (import ./host.nix { user = "tv"; }) ];
+# imports = [ (import ./modules/host { user = "tv"; }) ];
# The host's firewall has to let the guests in on fcbr0: DHCP (udp 67),
# DNS (udp and tcp 53) and the proxy (tcp proxyPort, after the redirect).
{ user, taps ? 8, proxyPort ? 10443 }: { lib, pkgs, ... }: let
diff --git a/egress.lua b/modules/host/egress.lua
index a019d7a..7a2b3af 100644
--- a/egress.lua
+++ b/modules/host/egress.lua
@@ -1,4 +1,4 @@
--- The guests' egress policy, for nginx (OpenResty), see host.nix.
+-- The guests' egress policy, for nginx (OpenResty), see default.nix.
--
-- The rules (one per line, read on every connection and request):
-- example.com example.com and its subdomains, passed through
diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix
index 3511dbb..44e9e7c 100644
--- a/pkgs/run-firecracker-vm/default.nix
+++ b/pkgs/run-firecracker-vm/default.nix
@@ -1,6 +1,6 @@
{ pkgs ? import <nixpkgs> {}
, kernelPackages ? pkgs.linuxPackages_latest
- # The CA of the host's egress proxy (see host.nix), if it's there.
+ # The CA of the host's egress proxy (see modules/host), if it's there.
, caCert ? "/var/lib/fcbr0-egress/ca.pem"
}:
let
@@ -150,7 +150,7 @@ let
networking.useDHCP = false;
networking.resolvconf.enable = false;
# The host resolves every name to itself and proxies TLS to allowed
- # names, decrypting some with certificates from its CA, see host.nix.
+ # names, decrypting some with certificates from its CA, see modules/host.
environment.etc."resolv.conf".text = "nameserver 172.16.0.1\n";
security.pki.certificateFiles =
lib.optional (builtins.pathExists caCert) (/. + caCert);
@@ -268,7 +268,7 @@ let
};
network-interfaces = [{
iface_id = "eth0";
- host_dev_name = "@TAP@"; # see host.nix
+ host_dev_name = "@TAP@"; # see modules/host
guest_mac = "@MAC@";
}];
drives = [{
@@ -347,7 +347,7 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ ''
tty_args="$tty_args systemd.tty.rows.ttyS0=$rows systemd.tty.columns.ttyS0=$cols"
fi
- # Take the first tap device (see host.nix) that no other VM holds. The
+ # Take the first tap device (see modules/host) that no other VM holds. The
# lock is held until the script exits. The MAC address is derived from
# the tap's number, so the VM gets the same DHCP lease every time.
tap=
@@ -360,7 +360,7 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ ''
exec {lock}>&-
done
if test -z "$tap"; then
- echo "$0: no free tap device fctap*, see host.nix" >&2
+ echo "$0: no free tap device fctap*, see modules/host" >&2
exit 1
fi
n=''${tap#fctap}