1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00

nixos/servnerr-4: checkpoint

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2023-01-06 16:52:25 -05:00
parent dfa475df5d
commit 49ba20790f
No known key found for this signature in database
4 changed files with 36 additions and 39 deletions

View file

@ -34,14 +34,14 @@ in {
kernelParams = [
# Enable serial console.
"console=ttyS0,115200n8"
"console=ttyS1,115200n8"
# 56GiB ZFS ARC.
"zfs.zfs_arc_max=58720256"
];
};
# Start getty over serial console.
systemd.services."serial-getty@ttyS0" = {
systemd.services."serial-getty@ttyS1" = {
enable = true;
# Make sure agetty spawns at boot and always restarts whenever it
# exits due to user logout.
@ -68,11 +68,11 @@ in {
apcupsd = {
enable = true;
configText = ''
UPSCABLE usb
UPSTYPE usb
DEVICE
UPSCLASS standalone
UPSMODE disable
UPSCABLE usb
UPSTYPE usb
DEVICE
UPSCLASS standalone
UPSMODE disable
'';
};

View file

@ -4,36 +4,29 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "mpt3sas" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/39344788-52df-410c-97ae-027887e10e2f";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/39344788-52df-410c-97ae-027887e10e2f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/726C-3D2A";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/726C-3D2A";
fsType = "vfat";
};
swapDevices = [{ device = "/dev/disk/by-uuid/6e3f67c8-74e9-42f0-8925-d444ada3696d"; }];
swapDevices =
[{ device = "/dev/disk/by-uuid/6e3f67c8-74e9-42f0-8925-d444ada3696d"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp7s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -160,7 +160,11 @@ in {
# SNMP relabeling configuration required to properly replace the instance
# names and query the correct devices.
(lib.mkMerge [
(staticScrape "snmp" [ "switch-livingroom01" "switch-office01" ])
(staticScrape "snmp" [
"switch-livingroom01"
"switch-office01"
"pdu01"
])
{
metrics_path = "/snmp";
params = { module = [ "if_mib" ]; };

View file

@ -130,12 +130,12 @@ let
in {
# primary zpool mounts.
fileSystems = lib.genAttrs [
#"/primary"
#"/primary/archive"
#"/primary/media"
#"/primary/misc"
#"/primary/text"
#"/primary/vm"
"/primary"
"/primary/archive"
"/primary/media"
"/primary/misc"
"/primary/text"
"/primary/vm"
] (device: {
# The device has the leading / removed.
device = builtins.substring 1 255 device;
@ -163,7 +163,7 @@ in {
services = {
# Enable tarsnap backups.
tarsnap = {
enable = false;
enable = true;
archives.archive = {
directories = [ "/primary/archive" ];
@ -204,7 +204,7 @@ in {
# Replicate ZFS pools using zrepl.
zrepl = {
enable = false;
enable = true;
settings = {
global.monitoring = [{
type = "prometheus";