WIP create VM for pppoe and tftpd

This commit is contained in:
Daniel Barlow
2023-02-14 22:08:52 +00:00
parent 9d651f5851
commit e84833e52f
5 changed files with 189 additions and 1 deletions

View File

@@ -20,6 +20,60 @@ let
./modules/outputs.nix
] pkgs;
borderVm = ((import <nixpkgs/nixos>) {
configuration =
{ config, ... }:
{
imports = [
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
];
boot.kernelParams = [
"loglevel=9"
];
systemd.services.pppoe =
let conf = pkgs.writeText "kpppoed.toml"
''
interface_name = "eth0"
services = [ "myservice" ]
lns_ipaddr = "90.155.53.19"
ac_name = "kpppoed-1.0"
'';
in {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.pkgsBuildBuild.go-l2tp}/bin/kpppoed -config ${conf}";
};
};
virtualisation = {
qemu = {
networkingOptions = [];
options = [
"-device vfio-pci,host=01:00.0"
"-nographic"
"-serial mon:stdio"
];
};
sharedDirectories = {
liminix = {
source = builtins.toString ./.;
target = "/home/liminix/liminix";
};
};
};
environment.systemPackages = [ pkgs.pkgsBuildBuild.tufted ];
security.sudo.wheelNeedsPassword = false;
networking = {
hostName = "border";
firewall = { enable = false; };
};
users.users.liminix = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel"];
};
services.getty.autologinUser = "liminix";
};
}).config.system;
in {
outputs = config.outputs // {
default = config.outputs.${config.device.defaultOutput};
@@ -35,6 +89,8 @@ in {
routeros.routeros
routeros.ros-exec-script
mips-vm
borderVm.build.vm
go-l2tp
];
};
}