mirror of
https://github.com/kmein/niveum
synced 2026-03-19 03:21:10 +01:00
Compare commits
3 Commits
8738cb4a58
...
01e3cef34f
| Author | SHA1 | Date | |
|---|---|---|---|
| 01e3cef34f | |||
| f921d3d3b6 | |||
| ffa3f820ce |
@@ -117,7 +117,7 @@ in
|
||||
⚠ <b>{{ index .Annotations "summary"}}</b>
|
||||
{{ index .Annotations "description" }}
|
||||
|
||||
See on <a href="http://${config.services.grafana.domain}/d/alpUteInz/niveum">Grafana</a>.
|
||||
See on Grafana: http://${config.services.grafana.domain}/d/alpUteInz/niveum
|
||||
{{ else -}}
|
||||
RESOLVED 😌 <del>{{ index .Annotations "summary"}}</del>
|
||||
{{- end }}
|
||||
|
||||
@@ -95,15 +95,30 @@ in {
|
||||
{
|
||||
block = "custom";
|
||||
interval = 60 * 60;
|
||||
command = let spacetime = import <niveum/configs/spacetime.nix>; in pkgs.writers.writePython3 "sun.py" { libraries = [ pkgs.python3Packages.astral ]; flakeIgnore = [ "E501" ]; }
|
||||
command = let spacetime = import <niveum/configs/spacetime.nix>; in pkgs.writers.writePython3 "sun.py" { libraries = [ pkgs.python3Packages.astral ]; flakeIgnore = [ "E121" "E501" ]; }
|
||||
''
|
||||
import astral
|
||||
import astral.moon
|
||||
import astral.sun
|
||||
|
||||
moon_phases = {
|
||||
0: "🌑",
|
||||
3.5: "🌒",
|
||||
7: "🌓",
|
||||
10.5: "🌔",
|
||||
14: "🌕",
|
||||
17.5: "🌖",
|
||||
21: "🌗",
|
||||
24.5: "🌘",
|
||||
28: "🌑",
|
||||
}
|
||||
current_phase = astral.moon.phase()
|
||||
closest_phase = min(moon_phases.keys(), key=lambda x: abs(current_phase - x))
|
||||
|
||||
city = astral.LocationInfo("Berlin", "Germany", "${spacetime.time.timeZone}", ${toString spacetime.location.latitude}, ${toString spacetime.location.longitude})
|
||||
sun = astral.sun.sun(city.observer, date=astral.today(), tzinfo=city.timezone)
|
||||
|
||||
print("🌅 {} 🌇 {}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R")))
|
||||
print("🌅 {} 🌇 {} {}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), moon_phases[closest_phase]))
|
||||
'';
|
||||
}
|
||||
{
|
||||
|
||||
@@ -37,6 +37,8 @@ let
|
||||
"that sucks!"
|
||||
"👎"
|
||||
"turn that down"
|
||||
"make it stooop"
|
||||
"noooo"
|
||||
];
|
||||
in
|
||||
pkgs.writers.writeDashBin "pls" ''
|
||||
|
||||
Reference in New Issue
Block a user