138 lines
2.7 KiB
Nix
138 lines
2.7 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
let
|
|
hostname = "nostromo";
|
|
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";
|
|
|
|
imports = [
|
|
../defaults.nix
|
|
../networks/sea.fudo.org.nix
|
|
../profiles/server.nix
|
|
../hardware-configuration.nix
|
|
|
|
../profiles/services/postgres.nix
|
|
# ../profiles/services/local_nameserver.nix
|
|
];
|
|
|
|
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;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
hardware.bluetooth.enable = false;
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
# ganesha
|
|
ipfs
|
|
libguestfs-with-appliance
|
|
libvirt
|
|
virtmanager
|
|
];
|
|
|
|
virtualisation.libvirtd = {
|
|
enable = true;
|
|
qemuPackage = pkgs.qemu_kvm;
|
|
onShutdown = "shutdown";
|
|
};
|
|
|
|
fileSystems = {
|
|
"/data/gluster0" = {
|
|
device = "/dev/nostromo-gluster/gluster0";
|
|
fsType = "xfs";
|
|
options = ["rw" "inode64" "noatime" "nouuid"];
|
|
};
|
|
};
|
|
|
|
services = {
|
|
# glusterfs = {
|
|
# enable = true;
|
|
# enableGlustereventsd = true;
|
|
# useRpcbind = true;
|
|
# };
|
|
|
|
# -DWITH_SPDK=OFF
|
|
# ceph = {
|
|
# enable = true;
|
|
|
|
# global = {
|
|
# clusterName = "sea-data";
|
|
|
|
# clusterNetwork = "10.0.10.0/24";
|
|
# publicNetwork = "10.0.0.0/23";
|
|
|
|
# monHost = "srv-1.data.sea.fudo.org";
|
|
# monInitialMembers = concatStringsSep "," [
|
|
# "srv-1.data.sea.fudo.org"
|
|
# #"srv-2.data.sea.fudo.org"
|
|
# ];
|
|
|
|
# authClientRequired = "cephx";
|
|
# authClusterRequired = "cephx";
|
|
# authServiceRequired = "cephx";
|
|
|
|
# fsid = "14c6fc0f-13f5-43ab-9b90-b012cd12cbaa";
|
|
# };
|
|
|
|
# mds = {
|
|
# enable = true;
|
|
# daemons = ["srv-1"];
|
|
# };
|
|
|
|
# mon = {
|
|
# enable = true;
|
|
# daemons = ["srv-1"];
|
|
# };
|
|
|
|
# osd = {
|
|
# enable = true;
|
|
# daemons = ["srv-1"];
|
|
# };
|
|
# };
|
|
};
|
|
|
|
# services.ipfs = {
|
|
# enable = true;
|
|
# enableGC = true;
|
|
# autoMount = false;
|
|
# defaultMode = "online";
|
|
# apiAddress = "/ip4/10.0.0.2/tcp/5001";
|
|
# gatewayAddress = "/ipv4/10.0.0.2/tcp/8080";
|
|
# };
|
|
}
|