Provides isolated development environments using either VMs (microvm.nix)
or containers (systemd-nspawn) with a unified configuration interface.
Features:
- Unified options with required type field ("vm" or "container")
- Shared base configuration for networking, SSH, users, packages
- Automatic SSH host key generation and persistence
- Shell aliases for workspace management (start/stop/status/ssh)
- Automatic /etc/hosts entries for workspace hostnames
- restartIfChanged support for both VMs and containers
- Passwordless doas in workspaces
Container backend:
- Uses hostBridge for proper bridge networking with /24 subnet
- systemd-networkd for IP configuration
- systemd-resolved for DNS
VM backend:
- TAP interface with deterministic MAC addresses
- virtiofs shares for workspace directories
- vsock CID generation
25 lines
426 B
Nix
25 lines
426 B
Nix
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.networking;
|
|
in
|
|
{
|
|
imports = [
|
|
./pia-openvpn.nix
|
|
./pia-wireguard.nix
|
|
./ping.nix
|
|
./tailscale.nix
|
|
./vpn.nix
|
|
./sandbox.nix
|
|
];
|
|
|
|
options.networking.ip_forward = mkEnableOption "Enable ip forwarding";
|
|
|
|
config = mkIf cfg.ip_forward {
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
|
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
|
|
};
|
|
}
|