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

feat: openweathermap tool and i3status block

This commit is contained in:
2021-04-04 11:12:17 +02:00
parent 80143fee87
commit f8b452901f
3 changed files with 35 additions and 0 deletions

View File

@@ -229,6 +229,7 @@ in {
./packages
./power-action.nix
./printing.nix
./openweathermap.nix
./wallpaper.nix
./redshift.nix
./retiolum.nix

View File

@@ -0,0 +1,19 @@
{ pkgs, lib, ... }:
let
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} "$@"
'';
};
environment.systemPackages = [ pkgs.weather ];
}

View File

@@ -71,9 +71,24 @@ in {
volume_full = "🔊 ";
volume_half = "🔉 ";
volume_muted = "🔇";
weather_sun = "🌣";
weather_clouds = "🌥";
weather_rain = "🌧";
weather_snow = "🌨";
weather_default = "🌡";
weather_thunder = "🌩";
};
};
block = [
{
block = "weather";
service = {
name = "openweathermap";
api_key = lib.strings.fileContents <secrets/openweathermap.key>;
city_id = "2950159";
units = "metric";
};
}
{
block = "custom";
interval = 20;