From af6b58bc087f745b900d47b41764b29ac554917e Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Apr 2021 21:40:35 +0200 Subject: [PATCH] realwallpaper: move pkgs into export --- krebs/3modules/realwallpaper.nix | 9 -------- krebs/5pkgs/simple/realwallpaper/default.nix | 23 ++++++++++++++++---- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/krebs/3modules/realwallpaper.nix b/krebs/3modules/realwallpaper.nix index cfa8a65ba..86b74a8ca 100644 --- a/krebs/3modules/realwallpaper.nix +++ b/krebs/3modules/realwallpaper.nix @@ -42,15 +42,6 @@ let description = "real wallpaper generator"; after = [ "network.target" ]; - path = with pkgs; [ - xplanet - imagemagick - inkscape - curl - file - jq - ]; - environment = { working_dir = cfg.workingDir; marker_url = cfg.marker; diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 04a2a6718..aafabb7b6 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -1,6 +1,21 @@ { pkgs, ... }: pkgs.writers.writeDashBin "generate-wallpaper" '' - set -euf + set -xeuf + + export PATH=${with pkgs; lib.makeBinPath [ + coreutils + curl + gnugrep + gnused + file + findutils + grib2json + imagemagick + inkscape + jq + nomads-cloud + xplanet + ]} # usage: getimg FILENAME URL fetch() { @@ -118,7 +133,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' # fetch clouds if they are older than 3h if ! test "$(find clouds-raw.png -mmin -180)"; then - ${pkgs.nomads-cloud}/bin/nomads-cloud clouds-raw.png + nomads-cloud clouds-raw.png fi in_size=3600x1800 @@ -161,14 +176,14 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fi if needs_rebuild krebs.png krebs-raw.svg; then - inkscape -z -e krebs.png -w 16 -h 16 krebs-raw.svg + inkscape --export-type="png" --export-width=16 --export-height=16 --export-filename=krebs.png krebs-raw.svg fi # -- Planets -- for planet in mercury venus mars jupiter saturn uranus neptune; do if needs_rebuild "$planet".png "$planet"-raw.svg; then sed -i 's/#000/#FE8019/g' "$planet"-raw.svg - inkscape -z -e "$planet".png -w 40 -h 40 "$planet"-raw.svg + inkscape --export-type="png" --export-width=40 --export-height=40 --export-filename="$planet.png" "$planet-raw.svg" fi done