2022-05-16 00:05:02 +01:00
|
|
|
{
|
|
|
|
nixos.systems.estuary = {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
nixpkgs = "mine";
|
|
|
|
home-manager = "unstable";
|
|
|
|
|
2022-05-17 23:27:14 +01:00
|
|
|
assignments.internal = {
|
|
|
|
name = "estuary.vm";
|
|
|
|
altNames = [ "fw" ];
|
|
|
|
ipv4 = {
|
|
|
|
address = "10.100.0.1";
|
|
|
|
gateway = null;
|
|
|
|
};
|
|
|
|
ipv6.address = "2a0e:97c0:4d1:0::1";
|
|
|
|
};
|
|
|
|
|
|
|
|
configuration = { lib, pkgs, modulesPath, config, systems, assignments, ... }:
|
2022-05-16 00:05:02 +01:00
|
|
|
let
|
|
|
|
inherit (lib) mkIf mkMerge;
|
2022-05-17 23:27:14 +01:00
|
|
|
inherit (lib.my) networkdAssignment;
|
2022-05-16 00:05:02 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
|
|
|
|
|
|
|
config = mkMerge [
|
|
|
|
{
|
|
|
|
boot.kernelParams = [ "console=ttyS0,115200n8" ];
|
|
|
|
fileSystems = {
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-label/ESP";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
"/nix" = {
|
|
|
|
device = "/dev/main/nix";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
"/persist" = {
|
|
|
|
device = "/dev/main/persist";
|
|
|
|
fsType = "ext4";
|
|
|
|
neededForBoot = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services = {
|
|
|
|
lvm = {
|
|
|
|
dmeventd.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.network = {
|
|
|
|
links = {
|
|
|
|
"10-wan" = {
|
|
|
|
matchConfig.MACAddress = "52:54:00:a1:b2:5f";
|
|
|
|
linkConfig.Name = "wan";
|
|
|
|
};
|
|
|
|
"10-base" = {
|
|
|
|
matchConfig.MACAddress = "52:54:00:ab:f1:52";
|
|
|
|
linkConfig.Name = "base";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networks = {
|
|
|
|
#"80-wan" = {
|
|
|
|
# matchConfig.Name = "wan";
|
|
|
|
# address = [
|
|
|
|
# "1.2.3.4/24"
|
|
|
|
# "2a00::2/64"
|
|
|
|
# ];
|
|
|
|
#};
|
|
|
|
"80-wan" = {
|
|
|
|
matchConfig.Name = "wan";
|
|
|
|
DHCP = "ipv4";
|
|
|
|
};
|
2022-05-17 23:27:14 +01:00
|
|
|
"80-base" = (networkdAssignment "base" assignments.internal) // {
|
2022-05-16 00:05:02 +01:00
|
|
|
networkConfig = {
|
2022-05-17 23:27:14 +01:00
|
|
|
IPv6AcceptRA = false;
|
2022-05-16 00:05:02 +01:00
|
|
|
IPv6SendRA = true;
|
|
|
|
IPMasquerade = "both";
|
|
|
|
};
|
2022-05-17 23:27:14 +01:00
|
|
|
ipv6SendRAConfig.DNS = [ assignments.internal.ipv6.address ];
|
|
|
|
ipv6Prefixes = [
|
|
|
|
{
|
|
|
|
ipv6PrefixConfig.Prefix = "2a0e:97c0:4d1:0::/64";
|
|
|
|
}
|
|
|
|
];
|
2022-05-16 00:05:02 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
my = {
|
|
|
|
server.enable = true;
|
|
|
|
|
|
|
|
firewall = {
|
|
|
|
trustedInterfaces = [ "base" ];
|
|
|
|
nat = {
|
|
|
|
enable = true;
|
|
|
|
externalInterface = "wan";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
(mkIf config.my.build.isDevVM {
|
|
|
|
systemd.network = {
|
|
|
|
netdevs."05-dummy-base".netdevConfig = {
|
|
|
|
Name = "base";
|
|
|
|
Kind = "dummy";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|