nix-config/modules/hosts/t480/dwm/dwmblocks/weather.nix
Oliver Davies ebec70a7dc
All checks were successful
/ check (push) Successful in 59s
Return early if the location is unknown
2025-09-13 21:55:31 +01:00

21 lines
419 B
Nix

{
flake.modules.homeManager.gui =
{ pkgs, ... }:
{
home.packages = [
(pkgs.writeShellApplication {
name = "status-weather";
runtimeInputs = with pkgs; [ curl ];
text = ''
out="$(curl -s https://wttr.in/Caerleon?format=%t)"
[[ "$out" == *"Unknown location"* ]] && exit 1
echo "$out"
'';
})
];
};
}