nixos-config/hosts/nostromo.nix

123 lines
2.3 KiB
Nix

{ lib, config, pkgs, ... }:
let
hostname = "nostromo.sea.fudo.org";
inherit (lib.strings) concatStringsSep;
in {
boot.kernelModules = [ "kvm-amd" ];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sdb";
hardware.bluetooth.enable = false;
imports = [
../defaults.nix
../hardware-configuration.nix
];
fudo.common = {
profile = "server";
site = "seattle";
};
networking = {
hostName = hostname;
defaultGateway = "10.0.0.1";
nameservers = [ "10.0.0.1" ];
# Turn off for hypervisor: dhcp by default everywhere is a fuckin pain.
dhcpcd.enable = false;
# Create a bridge for VMs to use
macvlans.intlan0 = {
interface = "eno1";
mode = "bridge";
};
interfaces = {
intlan0 = {
macAddress = "46:54:76:06:f1:10";
ipv4.addresses = [
{
address = "10.0.0.2";
prefixLength = 22;
}
{
address = "10.0.10.2";
prefixLength = 24;
}
];
};
};
};
fudo = {
postgresql = {
enable = true;
ssl-private-key = "/srv/nostromo/certs/private/privkey.pem";
ssl-certificate = "/srv/nostromo/certs/cert.pem";
keytab = "/srv/nostromo/keytabs/postgres.keytab";
local-networks = [
"10.0.0.1/24"
"127.0.0.1/8"
];
};
};
environment.systemPackages = with pkgs; [
ceph
libguestfs-with-appliance
libvirt
virtmanager
];
virtualisation.libvirtd = {
enable = true;
qemuPackage = pkgs.qemu_kvm;
onShutdown = "shutdown";
};
services = {
# glusterfs = {
# enable = true;
# enableGlustereventsd = true;
# useRpcbind = true;
# };
ceph = {
enable = true;
global = {
clusterName = "sea-data";
clusterNetwork = "10.0.10.0/24";
fsid = "d443e192-896d-4102-a60f-f8f0777eb2a3";
monHost = "10.0.10.2";
monInitialMembers = "mon-1";
publicNetwork = "10.0.0.0/22";
};
mds = {
enable = true;
daemons = ["srv-2"];
};
mgr = {
enable = true;
daemons = ["srv-2"];
};
mon = {
enable = true;
daemons = ["srv-2"];
};
};
};
}