1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/openweathermap.nix

25 lines
677 B
Nix
Raw Permalink Normal View History

2022-03-10 21:52:12 +01:00
{
pkgs,
lib,
...
2025-12-27 22:22:54 +01:00
}:
let
openweathermap-repo = pkgs.fetchFromGitHub {
owner = "ip1981";
repo = "openweathermap";
rev = "9cfef7b14ac5af7109449b54b1cb352b4c76167a";
sha256 = "0sm43wicvw2fy7nq65s8vch6jjb5bszqr4ilnhibayamj4jcpw53";
};
2025-12-27 22:22:54 +01:00
openweathermap = pkgs.haskellPackages.callCabal2nix "openweathermap" openweathermap-repo { };
openweathermap-key = lib.strings.fileContents <secrets/openweathermap.key>;
2025-12-27 22:22:54 +01:00
in
{
nixpkgs.config.packageOverrides = pkgs: {
weather = pkgs.writers.writeDashBin "weather" ''
${openweathermap}/bin/openweathermap --api-key ${openweathermap-key} "$@"
'';
};
2025-12-27 22:22:54 +01:00
environment.systemPackages = [ pkgs.weather ];
}