Skip to content

Commit

Permalink
feat(monitoring): add monitoring configuration for prometheus exporte…
Browse files Browse the repository at this point in the history
…rs and system packages

Add configuration for prometheus exporters (node, zfs, smartctl, ipmi) and system packages (ipmitool, lm_sensors) in the monitoring setup.

feat(samba): update allowed hosts in samba configuration

Update the allowed hosts in the samba configuration to include the IP range 100.64.

feat(zfs): enable ZFS trim in ZFS configuration

Enable ZFS trim functionality in the ZFS configuration to improve performance.

feat(nas): include monitoring configuration and additional ZFS pools

Include the monitoring configuration in the NAS setup and add extra ZFS pools named "tank-test" and "ssdtank-test".

fix(hardware): remove unnecessary blacklist entry in kernelParams

Remove unnecessary blacklist entry for i915 in the hardware configuration.
  • Loading branch information
billimek committed Feb 28, 2024
1 parent 24a9712 commit de21f52
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
39 changes: 39 additions & 0 deletions hosts/common/optional/monitoring.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
config,
lib,
pkgs,
...
}: {
environment.systemPackages = with pkgs; [
ipmitool
lm_sensors
];
networking.firewall.allowedTCPPorts = [
config.services.prometheus.exporters.node.port
config.services.prometheus.exporters.zfs.port
config.services.prometheus.exporters.smartctl.port
config.services.prometheus.exporters.ipmi.port
];
services.prometheus = {
exporters = {
node = {
enable = true;
enabledCollectors = ["systemd"];
disabledCollectors = ["textfile"];
port = 9001;
};
zfs = {
enable = true;
port = 9002;
};
smartctl = {
enable = true;
port = 9003;
};
ipmi = {
enable = true;
port = 9004;
};
};
};
}
2 changes: 1 addition & 1 deletion hosts/common/optional/samba.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
printcap name = /dev/null
guest account = nobody
map to guest = bad user
hosts allow = 10.0.7. 10.0.2. 10.2.0. 127.0.0.1 localhost
hosts allow = 10.0.7. 10.0.2. 10.2.0. 100.64. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
vfs objects = catia fruit streams_xattr
fruit:nfs_aces = no
Expand Down
3 changes: 2 additions & 1 deletion hosts/common/optional/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
}: {
boot.supportedFilesystems = [ "zfs" ]; # Enable ZFS support
boot.zfs.requestEncryptionCredentials = true; # If you're using ZFS encryption, set this to true to prompt for encryption passwords at boot
boot.zfs.extraPools = ["tank-test" "ssdtank-test"];

services.zfs.autoScrub = {
enable = true; # Enable automatic ZFS scrubbing
interval = "monthly"; # Set the scrubbing interval to 1 month
};

services.zfs.trim.enable = true;

environment.systemPackages = with pkgs; [ zfs ]; # Install the ZFS package
}
5 changes: 5 additions & 0 deletions hosts/nas/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
../common/nixos/users/nix
../common/optional/avahi.nix
../common/optional/fish.nix
../common/optional/monitoring.nix
../common/optional/nfs.nix
../common/optional/reboot-required.nix
../common/optional/samba.nix
Expand All @@ -37,7 +38,11 @@
# isNormalUser = true;
};
};

boot.zfs.extraPools = ["tank-test" "ssdtank-test"];

services.smartd.enable = true;

environment.systemPackages = with pkgs; [
ipmitool
lshw
Expand Down
3 changes: 1 addition & 2 deletions hosts/nas/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
boot.kernelModules = ["kvm-intel usb_storage"];
boot.extraModulePackages = [];

# TODO: not certain we actually need to blacklist i915 here..
boot.kernelParams = [ "i915.disable_display=1" "module_blacklist=i915" ];
boot.kernelParams = [ "i915.disable_display=1" ];

virtualisation.kvmgt.vgpus = {
"i915-GVTg_V5_8" = {
Expand Down

0 comments on commit de21f52

Please sign in to comment.