nix-config/hosts/server9/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

92 lines
2.0 KiB
Nix
Raw Normal View History

2023-06-14 23:59:26 +02:00
{ config, lib, pkgs, ... }:
2022-06-18 01:07:43 +02:00
{
imports = [
./hardware-configuration.nix
];
c3d2 = {
2023-05-19 21:38:16 +02:00
baremetal = true;
deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true;
};
boot = {
2022-06-18 01:07:43 +02:00
loader.grub = {
enable = true;
2022-06-21 14:11:31 +02:00
device = "/dev/sdc";
2022-06-18 01:07:43 +02:00
};
kernelParams = [
"preempt=none"
# No server/router runs any untrusted user code
"mitigations=off"
];
2023-06-16 20:08:33 +02:00
tmp = {
useTmpfs = true;
tmpfsSize = "80%";
};
2022-06-18 01:07:43 +02:00
};
networking = {
hostName = "server9";
hostId = "09090909";
};
2022-06-18 02:36:36 +02:00
# required by libvirtd
security.polkit.enable = true;
2022-06-29 20:04:57 +02:00
2023-06-23 18:23:17 +02:00
services = {
ceph = {
mds.package = pkgs.ceph_17_2;
mgr.package = pkgs.ceph_17_2;
mon.package = pkgs.ceph_17_2;
osd.package = pkgs.ceph_17_2;
rgw.package = pkgs.ceph_17_2;
};
# reserve resources for libvirt VMs
nomad.settings.client.reserved = {
cpu = 2300;
memory = 16 * 1024;
};
};
2023-01-02 17:37:29 +01:00
simd.arch = "westmere";
2022-12-28 01:45:10 +01:00
sops = {
defaultSopsFile = ./secrets.yaml;
secrets."machine-id" = {
mode = "444";
path = "/etc/machine-id";
};
2023-01-07 02:54:35 +01:00
secrets."ceph/osd.3/keyfile" = {};
2023-07-07 00:00:10 +02:00
secrets."ceph/osd.7/keyfile" = {};
2022-12-28 01:45:10 +01:00
};
skyflake.nomad.client.meta."c3d2.cpuSpeed" = "3";
2023-01-07 02:54:35 +01:00
skyflake.storage.ceph.osds = [ {
id = 3;
fsid = "54d56ab8-fc43-4e16-886d-3c82dcc1f8fe";
path = "/dev/zvol/tank/ceph-osd.3";
keyfile = config.sops.secrets."ceph/osd.3/keyfile".path;
deviceClass = "hdd";
2023-07-07 00:00:10 +02:00
} {
id = 7;
fsid = "a5450c3b-2e20-450b-a17a-d7938ee9d262";
path = "/dev/disk/by-id/wwn-0x600300570140a0c02c39f0863bd3c53e";
keyfile = config.sops.secrets."ceph/osd.7/keyfile".path;
deviceClass = "ssd";
2023-01-07 02:54:35 +01:00
} ];
2023-06-14 23:59:26 +02:00
# TODO: remove
skyflake.storage.ceph.package = lib.mkForce pkgs.ceph_17_2;
2022-06-21 14:10:59 +02:00
system.stateVersion = "21.11";
2023-05-19 21:38:16 +02:00
# TODO: enable for zw-ev and poelzi-ha until we find a better solution
2022-06-21 14:10:59 +02:00
virtualisation.libvirtd = {
enable = true;
onShutdown = "shutdown";
};
2022-06-18 01:07:43 +02:00
}