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