reduced power draw + update

This commit is contained in:
Simon Gardling 2024-10-02 13:07:14 -04:00
parent bb854afeaa
commit 0d94348de3
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
3 changed files with 43 additions and 3 deletions

View File

@ -125,6 +125,21 @@
#!/bin/sh
tmux -S /run/minecraft/${service_configs.minecraft.server_name}.sock attach
'')
(pkgs.writeScriptBin "disk-smart-test" ''
#!/bin/sh
set -e
if [[ $EUID -ne 0 ]]; then
echo "This command requires root."
exit 2
fi
DISKS=$(${pkgs.coreutils}/bin/ls /dev/sd* | ${pkgs.gnugrep}/bin/grep -v "[0-9]$")
for i in $DISKS; do
${pkgs.coreutils}/bin/echo -n "$i "
${pkgs.smartmontools}/bin/smartctl -a "$i" | ${pkgs.gnugrep}/bin/grep "SMART overall-health self-assessment test result:" | ${pkgs.coreutils}/bin/cut -d' ' -f6
done
'')
];
services.zfs = {
@ -136,6 +151,8 @@
let
no-rgb = pkgs.writeScriptBin "no-rgb" ''
#!/bin/sh
set -e
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | ${pkgs.gnugrep}/bin/grep -E '^[0-9]+: ' | ${pkgs.coreutils}/bin/wc -l)
for i in $(${pkgs.coreutils}/bin/seq 0 $(($NUM_DEVICES - 1))); do

23
flake.lock generated
View File

@ -56,13 +56,29 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1727665282,
"narHash": "sha256-oKtfbQB1MBypqIyzkC8QCQcVGOa1soaXaGgcBIoh14o=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "11c43c830e533dad1be527ecce379fcf994fbbb5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1727634051,
"narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=",
"lastModified": 1727802920,
"narHash": "sha256-HP89HZOT0ReIbI7IJZJQoJgxvB2Tn28V6XS3MNKnfLs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9",
"rev": "27e30d177e57d912d614c88c622dcfdb2e6e6515",
"type": "github"
},
"original": {
@ -95,6 +111,7 @@
"root": {
"inputs": {
"nix-minecraft": "nix-minecraft",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"quadlet-nix": "quadlet-nix"
}

View File

@ -5,6 +5,8 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# nixpkgs.url = "github:NixOS/nixpkgs/master";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
quadlet-nix.url = "github:SEIAROTg/quadlet-nix";
quadlet-nix.inputs.nixpkgs.follows = "nixpkgs";
@ -17,6 +19,7 @@
nixpkgs,
quadlet-nix,
nix-minecraft,
nixos-hardware,
...
}:
let
@ -88,6 +91,9 @@
modules = [
./configuration.nix
quadlet-nix.nixosModules.quadlet
nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-cpu-amd-zenpower
nixos-hardware.nixosModules.common-pc-ssd
(
{ pkgs, ... }:
{