2021-01-14 14:35:52 -08:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
hostname = "lambda";
|
|
|
|
host-internal-ip = "10.0.0.3";
|
|
|
|
host-storage-ip = "10.0.10.1";
|
|
|
|
inherit (lib.strings) concatStringsSep;
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
boot.kernelModules = [ "kvm-amd" ];
|
|
|
|
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
boot.loader.grub.device = "/dev/disk/by-label/nixos-root";
|
|
|
|
|
|
|
|
hardware.bluetooth.enable = false;
|
|
|
|
|
2021-01-14 15:43:22 -08:00
|
|
|
imports = [ ../defaults.nix ../hardware-configuration.nix ];
|
2021-01-14 14:35:52 -08:00
|
|
|
|
|
|
|
fudo.common = {
|
|
|
|
profile = "server";
|
|
|
|
site = "seattle";
|
|
|
|
};
|
|
|
|
|
2021-01-14 15:43:22 -08:00
|
|
|
fudo.slynk = { enable = true; };
|
2021-01-14 14:35:52 -08:00
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = hostname;
|
|
|
|
|
|
|
|
nameservers = [ host-internal-ip ];
|
|
|
|
|
|
|
|
# Create a bridge for VMs to use
|
|
|
|
macvlans = {
|
|
|
|
extif0 = {
|
|
|
|
interface = "enp3s0f1";
|
|
|
|
mode = "bridge";
|
|
|
|
};
|
|
|
|
storageif0 = {
|
|
|
|
interface = "enp4s0f1";
|
|
|
|
mode = "bridge";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
interfaces = {
|
|
|
|
enp3s0f0.useDHCP = false;
|
|
|
|
enp3s0f1.useDHCP = false;
|
|
|
|
enp4s0f0.useDHCP = false;
|
|
|
|
enp4s0f1.useDHCP = false;
|
|
|
|
|
|
|
|
extif0 = {
|
|
|
|
useDHCP = false;
|
|
|
|
macAddress = "02:50:f6:52:9f:9d";
|
2021-01-14 15:43:22 -08:00
|
|
|
ipv4.addresses = [{
|
|
|
|
address = host-internal-ip;
|
|
|
|
prefixLength = 22;
|
|
|
|
}
|
|
|
|
# {
|
|
|
|
# address = "10.0.10.2";
|
|
|
|
# prefixLength = 24;
|
|
|
|
# }
|
|
|
|
];
|
2021-01-14 14:35:52 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
storageif0 = {
|
|
|
|
useDHCP = false;
|
|
|
|
macAddress = "02:65:d7:00:7d:1b";
|
2021-01-14 15:43:22 -08:00
|
|
|
ipv4.addresses = [{
|
|
|
|
address = host-storage-ip;
|
|
|
|
prefixLength = 24;
|
|
|
|
}];
|
2021-01-14 14:35:52 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-14 15:43:22 -08:00
|
|
|
fudo.ipfs = {
|
|
|
|
enable = true;
|
|
|
|
users = [ "niten" ];
|
|
|
|
api-address = "/ip4/${host-internal-ip}/tcp/5001";
|
2021-01-14 14:35:52 -08:00
|
|
|
};
|
|
|
|
}
|