mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-02 13:06:11 +01:00
52 lines
878 B
Nix
52 lines
878 B
Nix
|
{
|
||
|
inputs',
|
||
|
pkgs,
|
||
|
lib,
|
||
|
...
|
||
|
}: let
|
||
|
inherit
|
||
|
(lib)
|
||
|
concatMap
|
||
|
;
|
||
|
in {
|
||
|
imports = [
|
||
|
inputs'.self.nixosModules.ifstate
|
||
|
inputs'.self.nixosModules.netnsIf
|
||
|
./qemu-vm.nix
|
||
|
];
|
||
|
nixpkgs.overlays = [
|
||
|
inputs'.self.overlays.ifstate
|
||
|
];
|
||
|
|
||
|
environment.systemPackages = [pkgs.tcpdump];
|
||
|
|
||
|
services.ifstate = {
|
||
|
enable = true;
|
||
|
|
||
|
settings = {
|
||
|
interfaces = [
|
||
|
{
|
||
|
name = "lan";
|
||
|
link = {
|
||
|
kind = "physical";
|
||
|
permaddr = "00:11:22:33:43:00";
|
||
|
state = "up";
|
||
|
};
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
|
||
|
networking = {
|
||
|
hostName = "client";
|
||
|
useDHCP = false;
|
||
|
interfaces.lan.useDHCP = true;
|
||
|
firewall.enable = false;
|
||
|
};
|
||
|
|
||
|
virtualisation.qemu.options = [
|
||
|
"-net nic,model=e1000,macaddr=00:11:22:33:43:00,netdev=lan"
|
||
|
"-netdev vde,id=lan,sock=../../../hel/switch"
|
||
|
];
|
||
|
}
|