Add UPS support
This commit is contained in:
@@ -7,3 +7,4 @@ Before making changes, read the appropriate entries of the following manuals:
|
||||
Do not read the entire manual at once, instead search only for what you need.
|
||||
|
||||
After editing nix configurations, always run `nix flake check nixos/` to check for errors.
|
||||
Do NOT attempt to rebuild the system, let the user handle that.
|
||||
|
||||
@@ -140,6 +140,29 @@
|
||||
# Set up virtualisation
|
||||
virtualisation.libvirtd.enable = true;
|
||||
|
||||
# UPS (Green Cell 2000VA)
|
||||
power.ups = {
|
||||
enable = true;
|
||||
mode = "standalone";
|
||||
ups.greencell = {
|
||||
driver = "nutdrv_qx";
|
||||
port = "auto";
|
||||
description = "Green Cell UPS 2000VA";
|
||||
directives = [
|
||||
"vendorid = 0001"
|
||||
"productid = 0000"
|
||||
];
|
||||
};
|
||||
users.upsmon = {
|
||||
passwordFile = "${pkgs.writeText "upsmon-password" "upsmonpass"}";
|
||||
upsmon = "primary";
|
||||
instcmds = [ "ALL" ];
|
||||
};
|
||||
upsmon.monitor.greencell = {
|
||||
user = "upsmon";
|
||||
};
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 11434 ]; # LMStudio (must be manually configured)
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
switcheroo
|
||||
wordbook
|
||||
textpieces
|
||||
gnome-sound-recorder
|
||||
|
||||
# Virtualisation
|
||||
gnome-boxes # VM management
|
||||
|
||||
@@ -24,27 +24,13 @@
|
||||
pkgs.openclaw-gateway
|
||||
pkgs.openclaw-tools
|
||||
pkgs.trash-cli
|
||||
pkgs.ollama
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
# Start ollama service if not already running
|
||||
if ! pgrep -x "ollama" > /dev/null; then
|
||||
echo "Starting ollama service..."
|
||||
ollama serve &>/dev/null &
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
# Pull model if needed (runs in background)
|
||||
if ! ollama list 2>/dev/null | grep -q "llama3.2:3b"; then
|
||||
echo "Pulling llama3.2:3b model (running in background)..."
|
||||
ollama pull llama3.2:3b &
|
||||
fi
|
||||
|
||||
# Start openclaw-gateway if not already running (uses ~/.openclaw config)
|
||||
if ! pgrep -f "openclaw-gateway" > /dev/null; then
|
||||
echo "Starting openclaw-gateway..."
|
||||
openclaw gateway &>/dev/null &
|
||||
openclaw gateway &
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user