WIP create VM for pppoe and tftpd
This commit is contained in:
56
default.nix
56
default.nix
@@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user