From 1e915baafbc56c4c626a3c3d042ac0e7d6276561 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Mar 2020 20:51:18 +0100 Subject: irc-announce cat2: use awk --- krebs/5pkgs/simple/irc-announce/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/5pkgs/simple/irc-announce/default.nix b/krebs/5pkgs/simple/irc-announce/default.nix index a90814aa9..52cf12862 100644 --- a/krebs/5pkgs/simple/irc-announce/default.nix +++ b/krebs/5pkgs/simple/irc-announce/default.nix @@ -25,10 +25,10 @@ pkgs.writeDashBin "irc-announce" '' # This is used to see what we send to the irc server. (debug output) echo2() { echo "$*"; echo "$*" >&2; } cat2() { - while read -r line; do - echo "$line" - echo "$line" >&2 - done + awk '{ + print $0 + print $0 > "/dev/stderr" + }' } # privmsg_cat transforms stdin to a privmsg -- cgit v1.2.3 From c12407200df12ef7397bf4fa0f96bb33ac96e0b7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 22 Mar 2020 12:37:50 +0100 Subject: nixpkgs: b7bbc6d -> bf7c0f0 --- krebs/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index e0b37d1fc..c5665a70a 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs-channels", - "rev": "b7bbc6d37878ed00b6467b574b02e840279f7d3d", - "date": "2020-02-26T11:51:29+01:00", - "sha256": "02q10jgi6m0vak3amb50ifw1pj82i17hs0npdkig7lsp8w3is7jq", + "rev": "bf7c0f0461e047bec108a5c5d5d1b144289a65ba", + "date": "2020-03-17T13:04:05+00:00", + "sha256": "01dsh9932x6xcba2p0xg4n563b85i3p7s2sakj7yf2ws8pgmwhq9", "fetchSubmodules": false } -- cgit v1.2.3 From 29263a2941b87d34883839f3368a1f1c5c3f687a Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 22 Mar 2020 13:18:59 +0100 Subject: nixpkgs-unstable: 55beed9 -> d96bd33 --- krebs/nixpkgs-unstable.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json index 1600d6f4a..847e3c61e 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs-channels", - "rev": "55beed9922c2f6b030af61ca7e33bd47850c68f2", - "date": "2020-02-26T03:53:16-05:00", - "sha256": "0jxkb3bl7axa6vmfsfdfx4mxv6wx0pc8iiwgrw2qh8wxhlhbylks", + "rev": "d96bd3394b734487d1c3bfbac0e8f17465e03afe", + "date": "2020-03-19T15:32:34+01:00", + "sha256": "05n27wz5ln9ni5cy5rhjcy612i44gmblkq5m0g827v8pd0nk00da", "fetchSubmodules": false } -- cgit v1.2.3 From ee59d7d72a29cc2b6c69a0d68a815eacfd980263 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 09:55:43 +0100 Subject: grib2json: init --- krebs/5pkgs/simple/grib2json/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 krebs/5pkgs/simple/grib2json/default.nix diff --git a/krebs/5pkgs/simple/grib2json/default.nix b/krebs/5pkgs/simple/grib2json/default.nix new file mode 100644 index 000000000..2a7959a75 --- /dev/null +++ b/krebs/5pkgs/simple/grib2json/default.nix @@ -0,0 +1,19 @@ +{ stdenv, fetchzip, makeWrapper, jre }: + +stdenv.mkDerivation { + name = "grib2json"; + src = fetchzip { + url = "https://github.com/krebs/grib2json-bin/archive/31efe677b40fe491c988d50f96b59b1b7e2d46f7.zip"; + sha256 = "1h3yxg270bvac7kaqsbsv4f8nln1i03rfz4cm8cp7llhjj3s6a6b"; + }; + installPhase = '' + mkdir -p $out/bin + cp -r lib $out/ + cat > $out/bin/grib2json << EOF + #!/bin/sh + set -x + ${jre}/bin/java -jar $out/lib/grib2json-0.8.0-SNAPSHOT.jar "\$@" + EOF + chmod +x $out/bin/grib2json + ''; +} -- cgit v1.2.3 From 539f783a7eba249f4221c4013032a05839ac3282 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 09:55:58 +0100 Subject: nomads-cloud: init --- krebs/5pkgs/simple/nomads-cloud/default.nix | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 krebs/5pkgs/simple/nomads-cloud/default.nix diff --git a/krebs/5pkgs/simple/nomads-cloud/default.nix b/krebs/5pkgs/simple/nomads-cloud/default.nix new file mode 100644 index 000000000..2af74dc44 --- /dev/null +++ b/krebs/5pkgs/simple/nomads-cloud/default.nix @@ -0,0 +1,43 @@ +{ writers, coreutils, grib2json, curl, jq, findutils, imagemagick }: +writers.writeDashBin "nomads-cloud" '' + prefix=$(mktemp -d) + grib_path=$prefix.grib + json_path=$prefix.json + pgm_path=$prefix.pgm + png_path="$1" + + mkdir -p "$prefix" + + date=$(${coreutils}/bin/date +%Y%m%d) + for hour in 18 12 06 00; do + url="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25_1hr.pl?file=gfs.t''${hour}z.pgrb2.0p25.anl&lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29=on&var_CWAT=on&leftlon=-180&rightlon=180&toplat=90&bottomlat=-90&dir=%2Fgfs.$date%2F$hour" + ${curl}/bin/curl -fsS "$url" > "$grib_path" + if [ "$?" -eq 0 ]; then + break + fi + done + ${grib2json}/bin/grib2json --data "$grib_path" > "$json_path" + + width=$(${jq}/bin/jq '.[0].header.nx' < "$json_path") + height=$(${jq}/bin/jq '.[0].header.ny' < "$json_path") + + # The maximum gray value. Must be bigger than 0 and less than 65536. + maxval=256 + + # pgm - Netpbm grayscale image format + # http://netpbm.sourceforge.net/doc/pgm.html + { + echo P2 + echo "$width $height" + echo "$maxval" + cat "$json_path" | + ${jq}/bin/jq --argjson maxval "$maxval" -c ' + .[0].data[] * $maxval | round + ' | + ${findutils}/bin/xargs -n "$width" + } > "$pgm_path" + + ${imagemagick}/bin/convert -roll +50% "$pgm_path" "$png_path" + + rm -r "$prefix" +'' -- cgit v1.2.3 From 2552d6321c309291147e3d7cc53501480b69f295 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 09:57:54 +0100 Subject: realwallpaper: add nomad-clouds as cloud provider --- krebs/5pkgs/simple/realwallpaper/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index ef83d2e59..3f75e9e1e 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -1,5 +1,5 @@ { pkgs, ... }: -pkgs.writeDashBin "generate-wallpaper" '' +pkgs.writers.writeDashBin "generate-wallpaper" '' set -euf # usage: getimg FILENAME URL @@ -68,15 +68,15 @@ pkgs.writeDashBin "generate-wallpaper" '' "$nightmap_url" & fetch daymap-raw.png \ "$daymap_url" & - fetch clouds-raw.jpg \ - "$cloudmap_url" & fetch marker.json \ "$marker_url" & wait + ${pkgs.nomads-cloud}/bin/nomads-cloud clouds-raw.png + check_type nightmap-raw.jpg image check_type daymap-raw.png image - check_type clouds-raw.jpg image + check_type clouds-raw.png image in_size=2048x1024 xplanet_out_size=1466x1200 @@ -87,7 +87,7 @@ pkgs.writeDashBin "generate-wallpaper" '' for raw in \ nightmap-raw.jpg \ daymap-raw.png \ - clouds-raw.jpg \ + clouds-raw.png \ ; do normal=''${raw%-raw.*}.png -- cgit v1.2.3 From cab3be8a19d445d3292454099dbc1ca97bca60c5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 09:58:10 +0100 Subject: realwallpaper: add subsolar/lunar points --- krebs/5pkgs/simple/realwallpaper/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 3f75e9e1e..b46cf08c1 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -128,6 +128,8 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' # create marker file from json if [ -s marker.json ]; then jq -r 'to_entries[] | @json "\(.value.latitude) \(.value.longitude)"' marker.json > marker_file + echo 'position=sun image=subsolar.png transparent={255,255,255}' >> marker_file + echo 'position=moon image=sublunar.png transparent={255,255,255}' >> marker_file fi # make all unmodified files as final -- cgit v1.2.3 From e4816a16f9144f4267856f87aa2879fff277730d Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 13:05:43 +0100 Subject: realwallpaper: use new sun/moon icons --- krebs/5pkgs/simple/realwallpaper/default.nix | 30 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index b46cf08c1..62d88e1e9 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -64,12 +64,17 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' cd "$working_dir" # fetch source images in parallel - fetch nightmap-raw.jpg \ - "$nightmap_url" & - fetch daymap-raw.png \ - "$daymap_url" & - fetch marker.json \ - "$marker_url" & + # fetch basic images which should not change + test -e nightmap-raw.jpg || fetch nightmap-raw.jpg "$nightmap_url" & + test -e sun-raw.png || fetch sun-raw.png \ + "http://simpleicon.com/wp-content/uploads/sun-64x64.png" & + + test -e moon-raw.png || fetch moon-raw.png \ + "http://simpleicon.com/wp-content/uploads/moon__star-64x64.png" & + + # regular fetches + fetch daymap-raw.png "$daymap_url" & + fetch marker.json "$marker_url" & wait ${pkgs.nomads-cloud}/bin/nomads-cloud clouds-raw.png @@ -112,6 +117,14 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' convert nightmap.png -threshold 25% nightmap-lightmask.png fi + if needs_rebuild sun.png sun-raw.png; then + convert sun-raw.png -fill gold -opaque black -resize 50% PNG64:sun.png + fi + + if needs_rebuild moon.png moon-raw.png; then + convert moon-raw.png -fill royalblue -opaque black -resize 50% PNG64:moon.png + fi + # create layers make_layer nightmap-snowlayer.png nightmap-fullsnow.png daymap-snowmask.png make_layer nightmap-lightlayer.png nightmap.png nightmap-lightmask.png @@ -125,11 +138,12 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' nightmap-lightsnowlayer.png \ nightmap.png + # create marker file from json if [ -s marker.json ]; then jq -r 'to_entries[] | @json "\(.value.latitude) \(.value.longitude)"' marker.json > marker_file - echo 'position=sun image=subsolar.png transparent={255,255,255}' >> marker_file - echo 'position=moon image=sublunar.png transparent={255,255,255}' >> marker_file + echo 'position=sun image=sun.png' >> marker_file + echo 'position=moon image=moon.png' >> marker_file fi # make all unmodified files as final -- cgit v1.2.3 From e2ef8aba938fb39f826014de919471c7ce751d83 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 13:05:55 +0100 Subject: fetch clouds only every 3h --- krebs/5pkgs/simple/realwallpaper/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 62d88e1e9..f81f96efe 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -77,7 +77,10 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fetch marker.json "$marker_url" & wait - ${pkgs.nomads-cloud}/bin/nomads-cloud clouds-raw.png + # 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 + fi check_type nightmap-raw.jpg image check_type daymap-raw.png image -- cgit v1.2.3 From 119b56956c8bcb992c86ca8d0e854884e7c44695 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 18:47:23 +0100 Subject: nomads-cloud: double sqrt for better clouds --- krebs/5pkgs/simple/nomads-cloud/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/nomads-cloud/default.nix b/krebs/5pkgs/simple/nomads-cloud/default.nix index 2af74dc44..9c39de891 100644 --- a/krebs/5pkgs/simple/nomads-cloud/default.nix +++ b/krebs/5pkgs/simple/nomads-cloud/default.nix @@ -22,7 +22,7 @@ writers.writeDashBin "nomads-cloud" '' height=$(${jq}/bin/jq '.[0].header.ny' < "$json_path") # The maximum gray value. Must be bigger than 0 and less than 65536. - maxval=256 + maxval=1000 # pgm - Netpbm grayscale image format # http://netpbm.sourceforge.net/doc/pgm.html @@ -32,7 +32,7 @@ writers.writeDashBin "nomads-cloud" '' echo "$maxval" cat "$json_path" | ${jq}/bin/jq --argjson maxval "$maxval" -c ' - .[0].data[] * $maxval | round + ((.[0].data[] | sqrt | sqrt) * $maxval | round) ' | ${findutils}/bin/xargs -n "$width" } > "$pgm_path" -- cgit v1.2.3 From e5cbe0cbe17a63854efc0271c1ae0d922a23572d Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Mar 2020 20:28:29 +0100 Subject: realwallpaper: use cloud_gamme instead of sqrt hack --- krebs/5pkgs/simple/nomads-cloud/default.nix | 2 +- krebs/5pkgs/simple/realwallpaper/default.nix | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/krebs/5pkgs/simple/nomads-cloud/default.nix b/krebs/5pkgs/simple/nomads-cloud/default.nix index 9c39de891..6e4ace484 100644 --- a/krebs/5pkgs/simple/nomads-cloud/default.nix +++ b/krebs/5pkgs/simple/nomads-cloud/default.nix @@ -32,7 +32,7 @@ writers.writeDashBin "nomads-cloud" '' echo "$maxval" cat "$json_path" | ${jq}/bin/jq --argjson maxval "$maxval" -c ' - ((.[0].data[] | sqrt | sqrt) * $maxval | round) + ((.[0].data[]) * $maxval | round) ' | ${findutils}/bin/xargs -n "$width" } > "$pgm_path" diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index f81f96efe..d28f20cb6 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -169,7 +169,8 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' map=daymap-final.png night_map=nightmap-final.png cloud_map=clouds-final.png - cloud_threshold=10 + cloud_threshold=1 + cloud_gamma=2.5 shade=15 ''} @@ -181,7 +182,8 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' map=daymap-final.png night_map=nightmap-final.png cloud_map=clouds-final.png - cloud_threshold=10 + cloud_threshold=1 + cloud_gamma=2.5 marker_file=marker_file shade=15 ''} -- cgit v1.2.3 From 4337f9dbce769cf64eba0c9ade8097145e782a83 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 24 Mar 2020 10:12:23 +0100 Subject: realwallpaper: add chlora water layer --- krebs/5pkgs/simple/realwallpaper/default.nix | 49 +++++++++++++++++++++------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index d28f20cb6..9be8f7c7c 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -73,8 +73,22 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' "http://simpleicon.com/wp-content/uploads/moon__star-64x64.png" & # regular fetches - fetch daymap-raw.png "$daymap_url" & fetch marker.json "$marker_url" & + + # fetch daymap twice daily + if ! test "$(find daymap-raw.png -mmin -720)"; then + fetch daymap-raw.png "$daymap_url" & + fi + + # fetch cholrophyl once every week + chlora_url=$(curl -Ss \ + 'https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MY1DMM_CHLORA&date=2999-12-31' \ + | grep '3600 x 1800' | sed 's/.*href="\([^"]*\)".*/\1/') + + if ! test "$(find chlora-raw.jpg -mtime -7)"; then + fetch chlora-raw.jpg "$chlora_url" & + fi + wait # fetch clouds if they are older than 3h @@ -96,6 +110,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' nightmap-raw.jpg \ daymap-raw.png \ clouds-raw.png \ + chlora-raw.jpg \ ; do normal=''${raw%-raw.*}.png @@ -105,7 +120,26 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fi done - # create nightmap-fullsnow + if needs_rebuild sun.png sun-raw.png; then + convert sun-raw.png -fill gold -opaque black -resize 50% PNG64:sun.png + fi + + if needs_rebuild moon.png moon-raw.png; then + convert moon-raw.png -fill royalblue -opaque black -resize 50% PNG64:moon.png + fi + + # -- Daymap -- + + # merge with water chlora layer + convert daymap.png chlora.png -compose lighten -composite daymap-final.png + + # -- Nightmap -- + + # merge with water chlora layer + convert nightmap.png \( -fill black -colorize 70% chlora.png \) \ + -compose lighten -composite nightmap-chlora.png + + # create nightmap-fullsnow, a big blue picture if needs_rebuild nightmap-fullsnow.png; then convert -size $in_size xc:$nightsnow_color nightmap-fullsnow.png fi @@ -120,14 +154,6 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' convert nightmap.png -threshold 25% nightmap-lightmask.png fi - if needs_rebuild sun.png sun-raw.png; then - convert sun-raw.png -fill gold -opaque black -resize 50% PNG64:sun.png - fi - - if needs_rebuild moon.png moon-raw.png; then - convert moon-raw.png -fill royalblue -opaque black -resize 50% PNG64:moon.png - fi - # create layers make_layer nightmap-snowlayer.png nightmap-fullsnow.png daymap-snowmask.png make_layer nightmap-lightlayer.png nightmap.png nightmap-lightmask.png @@ -139,7 +165,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' flatten nightmap-final.png \ nightmap-lightsnowlayer.png \ - nightmap.png + nightmap-chlora.png # create marker file from json @@ -151,7 +177,6 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' # make all unmodified files as final for normal in \ - daymap.png \ clouds.png \ ; do -- cgit v1.2.3 From c76f1618940ff188258212a0988d3de7525f9e9e Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 15:39:25 +0100 Subject: realwallpaper: redesign with new image sources --- krebs/3modules/realwallpaper.nix | 18 --- krebs/5pkgs/simple/realwallpaper/default.nix | 164 ++++++++++++--------------- 2 files changed, 73 insertions(+), 109 deletions(-) diff --git a/krebs/3modules/realwallpaper.nix b/krebs/3modules/realwallpaper.nix index a83758ccd..7a0052a4f 100644 --- a/krebs/3modules/realwallpaper.nix +++ b/krebs/3modules/realwallpaper.nix @@ -17,21 +17,6 @@ let default = "/var/realwallpaper/"; }; - nightmap = mkOption { - type = types.str; - default = "http://eoimages.gsfc.nasa.gov/images/imagerecords/55000/55167/earth_lights_lrg.jpg"; - }; - - daymap = mkOption { - type = types.str; - default = "https://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png"; - }; - - cloudmap = mkOption { - type = types.str; - default = "http://home.megapass.co.kr/~holywatr/cloud_data/clouds_2048.jpg"; - }; - marker = mkOption { type = types.str; default = "http://graph.r/marker.json"; @@ -67,9 +52,6 @@ let environment = { working_dir = cfg.workingDir; - nightmap_url = cfg.nightmap; - daymap_url = cfg.daymap; - cloudmap_url = cfg.cloudmap; marker_url = cfg.marker; }; diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 9be8f7c7c..dfe03ff35 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -17,24 +17,28 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fi } - # usage: image_size FILENAME - image_size() { - identify "$1" | awk '{print$3}' + # check if file exists and fetch only if missing + fetch_once() { + name=$1 + url=$2 + test -e "$name" || fetch "$name" "$url" } - # usage: make_mask DST SRC MASK - make_layer() { - if needs_rebuild "$@"; then - echo "make $1 (apply mask)" >&2 - convert "$2" "$3" -alpha off -compose copy_opacity -composite "$1" + fetch_older_min() { + min=$1 + name=$2 + url=$3 + if ! test "$(find $name -mmin -$min)"; then + fetch "$name" "$url" fi } - # usage: flatten DST HILAYER LOLAYER - flatten() { - if needs_rebuild "$@"; then - echo "make $1 (flatten)" >&2 - composite "$2" "$3" "$1" + fetch_older_days() { + days=$1 + name=$2 + url=$3 + if ! test "$(find $name -mmin -$days)"; then + fetch "$name" "$url" fi } @@ -60,35 +64,36 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' return $result } + get_neo_url() { + url=$1 + curl -Ss "$url" | grep '3600 x 1800' | sed 's/.*href="\([^"]*\)".*/\1/' + } + main() { cd "$working_dir" # fetch source images in parallel - # fetch basic images which should not change - test -e nightmap-raw.jpg || fetch nightmap-raw.jpg "$nightmap_url" & - test -e sun-raw.png || fetch sun-raw.png \ - "http://simpleicon.com/wp-content/uploads/sun-64x64.png" & - - test -e moon-raw.png || fetch moon-raw.png \ - "http://simpleicon.com/wp-content/uploads/moon__star-64x64.png" & + fetch_once sun-raw.png \ + 'http://simpleicon.com/wp-content/uploads/sun-64x64.png' & + fetch_once moon-raw.png \ + 'http://simpleicon.com/wp-content/uploads/moon__star-64x64.png' & + fetch_once nightmap-raw.jpg \ + 'https://eoimages.gsfc.nasa.gov/images/imagerecords/144000/144898/BlackMarble_2016_3km.jpg' & + fetch_once daymap-raw.tif \ + 'https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57752/land_shallow_topo_8192.tif' & + + fetch_older_min 720 ice-raw.jpg $(get_neo_url \ + 'https://neo.sci.gsfc.nasa.gov/view.php?datasetId=NISE_D') & + fetch_older_days 3 snow-raw.jpg $(get_neo_url \ + 'https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MOD10C1_E_SNOW') & + fetch_older_days 7 chlora-raw.jpg $(get_neo_url \ + 'https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MY1DMM_CHLORA') & + fetch_older_days 3 fire-raw.jpg $(get_neo_url \ + 'https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MOD14A1_E_FIRE') & # regular fetches fetch marker.json "$marker_url" & - # fetch daymap twice daily - if ! test "$(find daymap-raw.png -mmin -720)"; then - fetch daymap-raw.png "$daymap_url" & - fi - - # fetch cholrophyl once every week - chlora_url=$(curl -Ss \ - 'https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MY1DMM_CHLORA&date=2999-12-31' \ - | grep '3600 x 1800' | sed 's/.*href="\([^"]*\)".*/\1/') - - if ! test "$(find chlora-raw.jpg -mtime -7)"; then - fetch chlora-raw.jpg "$chlora_url" & - fi - wait # fetch clouds if they are older than 3h @@ -96,21 +101,26 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' ${pkgs.nomads-cloud}/bin/nomads-cloud clouds-raw.png fi + check_type sun-raw.png image + check_type moon-raw.png image check_type nightmap-raw.jpg image - check_type daymap-raw.png image + check_type daymap-raw.tif image + check_type ice-raw.jpg image + check_type snow-raw.jpg image + check_type chlora-raw.jpg image + check_type fire-raw.jpg image check_type clouds-raw.png image - in_size=2048x1024 + in_size=3600x1800 xplanet_out_size=1466x1200 out_geometry=1366x768+100+160 - nightsnow_color='#0c1a49' # nightmap - for raw in \ nightmap-raw.jpg \ - daymap-raw.png \ - clouds-raw.png \ + daymap-raw.tif \ + snow-raw.jpg \ chlora-raw.jpg \ + clouds-raw.png \ ; do normal=''${raw%-raw.*}.png @@ -120,6 +130,16 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fi done + # remove snow from ice map + if needs_rebuild ice.png ice-raw.jpg; then + convert ice-raw.jpg -fuzz 20% -fill black -opaque white -scale "$in_size" ice.png + fi + + # make fire more red + if needs_rebuild fire.png fire-raw.jpg; then + convert fire-raw.jpg -fuzz 20% -fill '#ef840c' -opaque white -scale "$in_size" fire.png + fi + if needs_rebuild sun.png sun-raw.png; then convert sun-raw.png -fill gold -opaque black -resize 50% PNG64:sun.png fi @@ -131,60 +151,22 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' # -- Daymap -- # merge with water chlora layer - convert daymap.png chlora.png -compose lighten -composite daymap-final.png - - # -- Nightmap -- - - # merge with water chlora layer - convert nightmap.png \( -fill black -colorize 70% chlora.png \) \ - -compose lighten -composite nightmap-chlora.png - - # create nightmap-fullsnow, a big blue picture - if needs_rebuild nightmap-fullsnow.png; then - convert -size $in_size xc:$nightsnow_color nightmap-fullsnow.png - fi - - # extract daymap-snowmask from daymap-final - if needs_rebuild daymap-snowmask.png daymap.png; then - convert daymap.png -threshold 95% daymap-snowmask.png - fi - - # extract nightmap-lightmask from nightmap - if needs_rebuild nightmap-lightmask.png nightmap.png; then - convert nightmap.png -threshold 25% nightmap-lightmask.png + if needs_rebuild daymap-final.png daymap.png fire.png snow.png ice.png chlora.png; then + convert daymap.png fire.png -compose lighten -composite daymap-1.png + convert daymap-1.png ice.png -compose lighten -composite daymap-2.png + convert daymap-2.png snow.png -compose lighten -composite daymap-3.png + convert daymap-3.png chlora.png -compose lighten -composite daymap-final.png fi - # create layers - make_layer nightmap-snowlayer.png nightmap-fullsnow.png daymap-snowmask.png - make_layer nightmap-lightlayer.png nightmap.png nightmap-lightmask.png - - # apply layers - flatten nightmap-lightsnowlayer.png \ - nightmap-lightlayer.png \ - nightmap-snowlayer.png - - flatten nightmap-final.png \ - nightmap-lightsnowlayer.png \ - nightmap-chlora.png - + # -- Nightmap -- - # create marker file from json - if [ -s marker.json ]; then - jq -r 'to_entries[] | @json "\(.value.latitude) \(.value.longitude)"' marker.json > marker_file - echo 'position=sun image=sun.png' >> marker_file - echo 'position=moon image=moon.png' >> marker_file + if needs_rebuild nightmap-final.png nightmap.png fire.png snow.png ice.png chlora.png; then + convert nightmap.png fire.png -compose lighten -composite nightmap-1.png + convert nightmap-1.png \( -fill black -colorize 70% ice.png \) -compose lighten -composite nightmap-2.png + convert nightmap-2.png \( -fill black -colorize 70% snow.png \) -compose lighten -composite nightmap-3.png + convert nightmap-3.png \( -fill black -colorize 70% chlora.png \) -compose lighten -composite nightmap-final.png fi - # make all unmodified files as final - for normal in \ - clouds.png \ - ; - do - final=''${normal%.png}-final.png - needs_rebuild $final && - ln $normal $final - done - # rebuild every time to update shadow xplanet --num_times 1 --geometry $xplanet_out_size \ --output xplanet-output.png --projection merc \ @@ -193,7 +175,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' "Earth" map=daymap-final.png night_map=nightmap-final.png - cloud_map=clouds-final.png + cloud_map=clouds.png cloud_threshold=1 cloud_gamma=2.5 shade=15 @@ -206,7 +188,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' "Earth" map=daymap-final.png night_map=nightmap-final.png - cloud_map=clouds-final.png + cloud_map=clouds.png cloud_threshold=1 cloud_gamma=2.5 marker_file=marker_file -- cgit v1.2.3 From a0347a6443ac07bbb986080dafe44af4a25e0f98 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 18:14:04 +0100 Subject: realwallpaper: add HD version with planets and krebs --- krebs/3modules/realwallpaper.nix | 1 + krebs/5pkgs/simple/realwallpaper/default.nix | 90 ++++++++++++++++++++++++++-- 2 files changed, 87 insertions(+), 4 deletions(-) diff --git a/krebs/3modules/realwallpaper.nix b/krebs/3modules/realwallpaper.nix index 7a0052a4f..cfa8a65ba 100644 --- a/krebs/3modules/realwallpaper.nix +++ b/krebs/3modules/realwallpaper.nix @@ -45,6 +45,7 @@ let path = with pkgs; [ xplanet imagemagick + inkscape curl file jq diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index dfe03ff35..1dd5e00e8 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -82,6 +82,24 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fetch_once daymap-raw.tif \ 'https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57752/land_shallow_topo_8192.tif' & + fetch_once mercury-raw.svg \ + 'https://upload.wikimedia.org/wikipedia/commons/2/2e/Mercury_symbol.svg' & + fetch_once venus-raw.svg \ + 'https://upload.wikimedia.org/wikipedia/commons/6/66/Venus_symbol.svg' & + fetch_once mars-raw.svg \ + 'https://upload.wikimedia.org/wikipedia/commons/b/b7/Mars_symbol.svg' & + fetch_once jupiter-raw.svg \ + 'https://upload.wikimedia.org/wikipedia/commons/2/26/Jupiter_symbol.svg' & + fetch_once saturn-raw.svg \ + 'https://upload.wikimedia.org/wikipedia/commons/7/74/Saturn_symbol.svg' & + fetch_once uranus-raw.svg \ + 'https://upload.wikimedia.org/wikipedia/commons/f/f1/Uranus_symbol.svg' & + fetch_once neptune-raw.svg \ + 'https://upload.wikimedia.org/wikipedia/commons/4/47/Neptune_symbol.svg' & + + fetch_once krebs-raw.svg \ + 'https://raw.githubusercontent.com/krebs/painload/master/cholerab/bling/krebs_aquarium.svg' & + fetch_older_min 720 ice-raw.jpg $(get_neo_url \ 'https://neo.sci.gsfc.nasa.gov/view.php?datasetId=NISE_D') & fetch_older_days 3 snow-raw.jpg $(get_neo_url \ @@ -111,9 +129,19 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' check_type fire-raw.jpg image check_type clouds-raw.png image + check_type mercury-raw.svg image + check_type venus-raw.svg image + check_type mars-raw.svg image + check_type jupiter-raw.svg image + check_type saturn-raw.svg image + check_type uranus-raw.svg image + check_type neptune-raw.svg image + + check_type krebs-raw.svg image + in_size=3600x1800 - xplanet_out_size=1466x1200 - out_geometry=1366x768+100+160 + xplanet_out_size=3600x2950 + out_geometry=3200x1800+300+400 for raw in \ nightmap-raw.jpg \ @@ -141,11 +169,52 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fi if needs_rebuild sun.png sun-raw.png; then - convert sun-raw.png -fill gold -opaque black -resize 50% PNG64:sun.png + convert sun-raw.png -fill gold -opaque black PNG64:sun.png fi if needs_rebuild moon.png moon-raw.png; then - convert moon-raw.png -fill royalblue -opaque black -resize 50% PNG64:moon.png + convert moon-raw.png -fill royalblue -opaque black PNG64:moon.png + fi + + # -- Planets -- + + if needs_rebuild mercury.png mercury-raw.svg; then + sed -i 's/#000/#A6A6A6/g' mercury-raw.svg + inkscape -z -e mercury.png -w 40 -h 40 mercury-raw.svg + fi + + if needs_rebuild venus.png venus-raw.svg; then + sed -i 's/#000/#C40B98/g' venus-raw.svg + inkscape -z -e venus.png -w 40 -h 40 venus-raw.svg + fi + + if needs_rebuild mars.png mars-raw.svg; then + sed -i 's/#000/#E35A5C/g' mars-raw.svg + inkscape -z -e mars.png -w 40 -h 40 mars-raw.svg + fi + + if needs_rebuild jupiter.png jupiter-raw.svg; then + sed -i 's/#000/#DEA182/g' jupiter-raw.svg + inkscape -z -e jupiter.png -w 40 -h 40 jupiter-raw.svg + fi + + if needs_rebuild saturn.png saturn-raw.svg; then + sed -i 's/#000/#E4C282/g' saturn-raw.svg + inkscape -z -e saturn.png -w 40 -h 40 saturn-raw.svg + fi + + if needs_rebuild uranus.png uranus-raw.svg; then + sed -i 's/#000/#97BCC2/g' uranus-raw.svg + inkscape -z -e uranus.png -w 40 -h 40 uranus-raw.svg + fi + + if needs_rebuild neptune.png neptune-raw.svg; then + sed -i 's/#000/#274687/g' neptune-raw.svg + inkscape -z -e neptune.png -w 40 -h 40 neptune-raw.svg + fi + + if needs_rebuild krebs.png krebs-raw.svg; then + inkscape -z -e krebs.png -w 16 -h 16 krebs-raw.svg fi # -- Daymap -- @@ -167,6 +236,19 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' convert nightmap-3.png \( -fill black -colorize 70% chlora.png \) -compose lighten -composite nightmap-final.png fi + # create marker file from json + if [ -s marker.json ]; then + jq -r 'to_entries[] | @json "\(.value.latitude) \(.value.longitude) image=krebs.png"' marker.json > marker_file + echo 'position=sun image=sun.png' >> marker_file + echo 'position=moon image=moon.png' >> marker_file + echo 'position=mercury image=mercury.png' >> marker_file + echo 'position=venus image=venus.png' >> marker_file + echo 'position=mars image=mars.png' >> marker_file + echo 'position=jupiter image=jupiter.png' >> marker_file + echo 'position=uranus image=uranus.png' >> marker_file + echo 'position=neptune image=neptune.png' >> marker_file + fi + # rebuild every time to update shadow xplanet --num_times 1 --geometry $xplanet_out_size \ --output xplanet-output.png --projection merc \ -- cgit v1.2.3 From a998c96889dd314c8b58c39adac5747ae2cc0c72 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 19:11:53 +0100 Subject: realwallpaper: fix fetch_older_days --- krebs/5pkgs/simple/realwallpaper/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 1dd5e00e8..ce0c6067e 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -37,7 +37,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' days=$1 name=$2 url=$3 - if ! test "$(find $name -mmin -$days)"; then + if ! test "$(find $name -mtime -$days)"; then fetch "$name" "$url" fi } -- cgit v1.2.3 From 013fcd7d47c7526254963888fa6d4476d9e55d14 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 19:12:18 +0100 Subject: realwallpaper: show more earth --- krebs/5pkgs/simple/realwallpaper/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index ce0c6067e..c2ca0498b 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -140,8 +140,8 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' check_type krebs-raw.svg image in_size=3600x1800 - xplanet_out_size=3600x2950 - out_geometry=3200x1800+300+400 + xplanet_out_size=3200x2500 + out_geometry=3200x1800+100+350 for raw in \ nightmap-raw.jpg \ -- cgit v1.2.3 From c08493708f789de9046f6fae00d89092b3786cf0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 19:12:31 +0100 Subject: realwallpaper: more clouds --- krebs/5pkgs/simple/realwallpaper/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index c2ca0498b..d2e49fcaf 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -259,7 +259,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' night_map=nightmap-final.png cloud_map=clouds.png cloud_threshold=1 - cloud_gamma=2.5 + cloud_gamma=6 shade=15 ''} @@ -272,7 +272,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' night_map=nightmap-final.png cloud_map=clouds.png cloud_threshold=1 - cloud_gamma=2.5 + cloud_gamma=6 marker_file=marker_file shade=15 ''} -- cgit v1.2.3 From a91fff125a3b46533db667d45493e107e9d83eea Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 20:07:45 +0100 Subject: realwallpaper: show full horizontal size --- krebs/5pkgs/simple/realwallpaper/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index d2e49fcaf..9298ef8ed 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -141,7 +141,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' in_size=3600x1800 xplanet_out_size=3200x2500 - out_geometry=3200x1800+100+350 + out_geometry=3200x1800+0+350 for raw in \ nightmap-raw.jpg \ -- cgit v1.2.3 From 6b3c216571f75ab39653f2a2bad5bc20c83b5c27 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 20:08:03 +0100 Subject: realwallpaper: darker snow --- krebs/5pkgs/simple/realwallpaper/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 9298ef8ed..81c4c0f67 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -146,7 +146,6 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' for raw in \ nightmap-raw.jpg \ daymap-raw.tif \ - snow-raw.jpg \ chlora-raw.jpg \ clouds-raw.png \ ; @@ -163,6 +162,10 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' convert ice-raw.jpg -fuzz 20% -fill black -opaque white -scale "$in_size" ice.png fi + if needs_rebuild snow.png snow-raw.jpg; then + convert snow-raw.jpg -fuzz 20% -fill '#DEDEDE' -opaque white -scale "$in_size" snow.png + fi + # make fire more red if needs_rebuild fire.png fire-raw.jpg; then convert fire-raw.jpg -fuzz 20% -fill '#ef840c' -opaque white -scale "$in_size" fire.png -- cgit v1.2.3 From b7b84cd4c9b41b4452bffb988650f49abdd10a79 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 Mar 2020 20:08:18 +0100 Subject: realwallpaper: add missing saturn --- krebs/5pkgs/simple/realwallpaper/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 81c4c0f67..65493d18e 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -248,6 +248,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' echo 'position=venus image=venus.png' >> marker_file echo 'position=mars image=mars.png' >> marker_file echo 'position=jupiter image=jupiter.png' >> marker_file + echo 'position=saturn image=saturn.png' >> marker_file echo 'position=uranus image=uranus.png' >> marker_file echo 'position=neptune image=neptune.png' >> marker_file fi -- cgit v1.2.3 From c9490c38abccb9ea085fb315d7a8d0085a61e495 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 26 Mar 2020 17:00:27 +0100 Subject: realwallpaper: even more clouds --- krebs/5pkgs/simple/realwallpaper/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 65493d18e..141e29117 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -263,7 +263,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' night_map=nightmap-final.png cloud_map=clouds.png cloud_threshold=1 - cloud_gamma=6 + cloud_gamma=10 shade=15 ''} @@ -276,7 +276,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' night_map=nightmap-final.png cloud_map=clouds.png cloud_threshold=1 - cloud_gamma=6 + cloud_gamma=10 marker_file=marker_file shade=15 ''} -- cgit v1.2.3 From 4e6981bc5ce17b9e9743f8c006375cec34609099 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 28 Mar 2020 18:51:43 +0100 Subject: nixpkgs: bf7c0f0 -> 598a9cb --- krebs/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index c5665a70a..123d624d8 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs-channels", - "rev": "bf7c0f0461e047bec108a5c5d5d1b144289a65ba", - "date": "2020-03-17T13:04:05+00:00", - "sha256": "01dsh9932x6xcba2p0xg4n563b85i3p7s2sakj7yf2ws8pgmwhq9", + "rev": "598a9cbed6348ebda43c6b1a9a3061e0206297e7", + "date": "2020-03-28T03:06:32+01:00", + "sha256": "12m910j2sfhm3a6skw4janxy010gzdxp15bn8v9w7w9hhjzvdw8c", "fetchSubmodules": false } -- cgit v1.2.3 From 897129926bf9c882831b76c331bc662cc170d0f6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 28 Mar 2020 18:54:51 +0100 Subject: jeschli: pin emacs-overlay version --- jeschli/2configs/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index f866bbca9..1ede96232 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -4,7 +4,7 @@ let pkgsWithOverlay = import { overlays = [ (import (builtins.fetchTarball { - url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz; + url = https://github.com/nix-community/emacs-overlay/archive/403c14c23be188b58c0b1bc197b428041d8a0cea.tar.gz; })) ]; }; -- cgit v1.2.3 From a29d406c681dcc95230db76cc6f0038b98b8adbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 2 Feb 2020 12:48:15 +0000 Subject: m: drop idontcare, add herbert --- krebs/3modules/external/mic92.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index a748b1454..23ab4f684 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -144,24 +144,24 @@ in { }; }; }; - idontcare = { + herbert = { owner = config.krebs.users.Mic92; nets = rec { retiolum = { addrs = [ - config.krebs.hosts.idontcare.nets.retiolum.ip4.addr - config.krebs.hosts.idontcare.nets.retiolum.ip6.addr + config.krebs.hosts.herbert.nets.retiolum.ip4.addr + config.krebs.hosts.herbert.nets.retiolum.ip6.addr ]; ip4.addr = "10.243.29.177"; - aliases = [ "idontcare.r" ]; + aliases = [ "herbert.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- - MIIBCgKCAQEAxmmbQLVXcnCU9Vg9TCoJxfq/RyNfzaTj8XJsn4Kpo3CvQOwFzL6O - qZnbG55WjPjPumuFgtUdHA/G8mgtrTVaIRbVE9ck2l2wWFzMWxORzuvDbMh5xP8A - OW2Z2qjlH6O9GTBCzpYyHuyBWCjtiN4x9zEqxkIsBARKOylAoy3zQIiiQF0d72An - lqKFi9vYUU90zo9rP8BTzx2ZsEWb28xhHUlwf1+vgaOHI1jI99gnr12dVYl/i/Hb - O28gDUogfpP/5pWFAHJ+53ZscHo8/Y7imjiKgGXmOHywoXOsKQ67M6ROEU/0xPnw - jKmq2p7zTJk2mDhphjePi5idd5yKNX5Q3wIDAQAB + MIIBCgKCAQEA7ZINr8YxVwHtcOR+ySpc9UjnJWsFXlOyu3CnrJ8IrY+mPA25UmNZ + stXd8QbJuxpad9HyPs294uW8UmXttEZzIwAlikVHasM5IQHVltudTTFvv7s3YFWd + /lgpHbo8zOA2mafx+Sr02Fy/lHjk6BTf8IOzdJIpUHZL/P+FUl9baBwGLmtbEvPh + fbvtf5QryBjJ9nRnb+wsPVpeFE/LncIMK/bYQsyE01T5QDu/muAaeYPbgm6FqaQH + OJ4oEHsarWBvU1qzgz/IRz0BHHeTrbbP3AG/glTwL02Z1mtTXSjME7cfk7ZRM5Cj + jXAqnqu2m1B08Kii+zYp4BPZDmPLT5gq+QIDAQAB -----END RSA PUBLIC KEY----- ''; }; -- cgit v1.2.3 From 274424528464d7f09e65df27a255c2a88af8547f Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 30 Mar 2020 18:45:28 +0200 Subject: realwallpaper: render moon.png with xplanet --- krebs/5pkgs/simple/realwallpaper/default.nix | 60 ++++++++-------------------- 1 file changed, 16 insertions(+), 44 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 141e29117..a900a849b 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -75,8 +75,6 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' # fetch source images in parallel fetch_once sun-raw.png \ 'http://simpleicon.com/wp-content/uploads/sun-64x64.png' & - fetch_once moon-raw.png \ - 'http://simpleicon.com/wp-content/uploads/moon__star-64x64.png' & fetch_once nightmap-raw.jpg \ 'https://eoimages.gsfc.nasa.gov/images/imagerecords/144000/144898/BlackMarble_2016_3km.jpg' & fetch_once daymap-raw.tif \ @@ -120,7 +118,6 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' fi check_type sun-raw.png image - check_type moon-raw.png image check_type nightmap-raw.jpg image check_type daymap-raw.tif image check_type ice-raw.jpg image @@ -175,51 +172,18 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' convert sun-raw.png -fill gold -opaque black PNG64:sun.png fi - if needs_rebuild moon.png moon-raw.png; then - convert moon-raw.png -fill royalblue -opaque black PNG64:moon.png - fi - - # -- Planets -- - - if needs_rebuild mercury.png mercury-raw.svg; then - sed -i 's/#000/#A6A6A6/g' mercury-raw.svg - inkscape -z -e mercury.png -w 40 -h 40 mercury-raw.svg - fi - - if needs_rebuild venus.png venus-raw.svg; then - sed -i 's/#000/#C40B98/g' venus-raw.svg - inkscape -z -e venus.png -w 40 -h 40 venus-raw.svg - fi - - if needs_rebuild mars.png mars-raw.svg; then - sed -i 's/#000/#E35A5C/g' mars-raw.svg - inkscape -z -e mars.png -w 40 -h 40 mars-raw.svg - fi - - if needs_rebuild jupiter.png jupiter-raw.svg; then - sed -i 's/#000/#DEA182/g' jupiter-raw.svg - inkscape -z -e jupiter.png -w 40 -h 40 jupiter-raw.svg - fi - - if needs_rebuild saturn.png saturn-raw.svg; then - sed -i 's/#000/#E4C282/g' saturn-raw.svg - inkscape -z -e saturn.png -w 40 -h 40 saturn-raw.svg - fi - - if needs_rebuild uranus.png uranus-raw.svg; then - sed -i 's/#000/#97BCC2/g' uranus-raw.svg - inkscape -z -e uranus.png -w 40 -h 40 uranus-raw.svg - fi - - if needs_rebuild neptune.png neptune-raw.svg; then - sed -i 's/#000/#274687/g' neptune-raw.svg - inkscape -z -e neptune.png -w 40 -h 40 neptune-raw.svg - fi - if needs_rebuild krebs.png krebs-raw.svg; then inkscape -z -e krebs.png -w 16 -h 16 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/#FFFF00/g' "$planet"-raw.svg + inkscape -z -e "$planet".png -w 40 -h 40 "$planet"-raw.svg + fi + done + # -- Daymap -- # merge with water chlora layer @@ -253,6 +217,14 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' echo 'position=neptune image=neptune.png' >> marker_file fi + # generate moon + xplanet -body moon --num_times 1 -origin earth \ + --transpng moon.png --geometry 50x50 \ + -config ${pkgs.writeText "moon.config" '' + [moon] + shade=10 + ''} + # rebuild every time to update shadow xplanet --num_times 1 --geometry $xplanet_out_size \ --output xplanet-output.png --projection merc \ -- cgit v1.2.3 From 07592647d1c19ce4997be05b882f63fb6b562f47 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 31 Mar 2020 17:26:09 +0200 Subject: realwallpaper: get sun image from sdo --- krebs/5pkgs/simple/realwallpaper/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index a900a849b..00c185391 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -73,8 +73,6 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' cd "$working_dir" # fetch source images in parallel - fetch_once sun-raw.png \ - 'http://simpleicon.com/wp-content/uploads/sun-64x64.png' & fetch_once nightmap-raw.jpg \ 'https://eoimages.gsfc.nasa.gov/images/imagerecords/144000/144898/BlackMarble_2016_3km.jpg' & fetch_once daymap-raw.tif \ @@ -109,6 +107,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' # regular fetches fetch marker.json "$marker_url" & + fetch sun-raw.jpg 'https://sdo.gsfc.nasa.gov/assets/img/latest/latest_512_0171.jpg' & wait @@ -117,7 +116,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' ${pkgs.nomads-cloud}/bin/nomads-cloud clouds-raw.png fi - check_type sun-raw.png image + check_type sun-raw.jpg image check_type nightmap-raw.jpg image check_type daymap-raw.tif image check_type ice-raw.jpg image @@ -168,8 +167,11 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' convert fire-raw.jpg -fuzz 20% -fill '#ef840c' -opaque white -scale "$in_size" fire.png fi - if needs_rebuild sun.png sun-raw.png; then - convert sun-raw.png -fill gold -opaque black PNG64:sun.png + # cut out sun with alpha transparency + if needs_rebuild sun.png sun-raw.jpg; then + convert sun-raw.jpg \ + \( +clone -colorspace HSB -fill white -draw "circle 256,256 256,54" -separate -delete 0,1 \) \ + -compose copyopacity -composite -crop 512x472+0+20 -scale "100x100" sun.png fi if needs_rebuild krebs.png krebs-raw.svg; then @@ -179,7 +181,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' # -- 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/#FFFF00/g' "$planet"-raw.svg + sed -i 's/#000/#FE8019/g' "$planet"-raw.svg inkscape -z -e "$planet".png -w 40 -h 40 "$planet"-raw.svg fi done -- cgit v1.2.3 From 5c6e007dbeb691cdadafa6615c5b23b40b6b77af Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 31 Mar 2020 17:26:28 +0200 Subject: realwallpaper: archive old wallpapers --- krebs/5pkgs/simple/realwallpaper/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix index 00c185391..2b0f4bd53 100644 --- a/krebs/5pkgs/simple/realwallpaper/default.nix +++ b/krebs/5pkgs/simple/realwallpaper/default.nix @@ -266,6 +266,8 @@ pkgs.writers.writeDashBin "generate-wallpaper" '' convert xplanet-krebs-output.png -crop $out_geometry \ realwallpaper-krebs-tmp.png mv realwallpaper-krebs-tmp.png realwallpaper-krebs.png + mkdir -p archive + convert realwallpaper-krebs.png archive/"$(date -Is)".jpg fi } -- cgit v1.2.3 From c7bc2cb7c28c2542e549c76195eb9a9d9cbb8e96 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 5 Apr 2020 11:46:38 +0200 Subject: l radio: kill skipped tracks --- lass/2configs/radio.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index b24d7af3e..639caa178 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -9,13 +9,25 @@ let admin-password = import ; source-password = import ; + music_dir = "/home/radio/music"; + add_random = pkgs.writeDashBin "add_random" '' ${pkgs.mpc_cli}/bin/mpc add "$(${pkgs.mpc_cli}/bin/mpc ls the_playlist/music | grep '\.ogg$' | shuf -n1)" ''; skip_track = pkgs.writeDashBin "skip_track" '' ${add_random}/bin/add_random - echo skipping: "$(${print_current}/bin/print_current)" + current_track=$(${pkgs.mpc_cli}/bin/mpc current -f %file%) + track_infos=$(${print_current}/bin/print_current) + skip_count=$(${pkgs.attr}/bin/getfattr -n user.skip_count --only-values "$current_track" || echo 0) + if [ "$skip_count" -gt 2 ]; then + mv "$music_dir"/"$current_track" "$music_dir"/.graveyard/ + echo killing: "$track_infos" + else + skip_count=$((skip_count+1)) + ${pkgs.attr}/bin/setfattr -n user.skip_count -v "$skip_count" "$music_dir"/"$current_track" + echo skipping: "$track_infos" skip_count: "$skip_count" + fi ${pkgs.mpc_cli}/bin/mpc -q next ''; @@ -57,7 +69,7 @@ in { services.mpd = { enable = true; group = "radio"; - musicDirectory = "/home/radio/music"; + musicDirectory = "${music_dir}"; extraConfig = '' log_level "default" auto_update "yes" -- cgit v1.2.3 From e6b18f0f178fa47ddb46952de6d103e2904d519a Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 5 Apr 2020 12:24:12 +0200 Subject: l radio skip_track: set music_dir --- lass/2configs/radio.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index 639caa178..c89dc91e5 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -16,7 +16,10 @@ let ''; skip_track = pkgs.writeDashBin "skip_track" '' + set -eu + ${add_random}/bin/add_random + music_dir=${escapeShellArg music_dir} current_track=$(${pkgs.mpc_cli}/bin/mpc current -f %file%) track_infos=$(${print_current}/bin/print_current) skip_count=$(${pkgs.attr}/bin/getfattr -n user.skip_count --only-values "$current_track" || echo 0) -- cgit v1.2.3 From 0a9aa4bc575364ec7a4d477ea98325a8282fde56 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 8 Apr 2020 11:13:54 +0200 Subject: l radio: prefix commands with the_playlist: --- lass/2configs/radio.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index c89dc91e5..1a5aadeba 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -22,7 +22,7 @@ let music_dir=${escapeShellArg music_dir} current_track=$(${pkgs.mpc_cli}/bin/mpc current -f %file%) track_infos=$(${print_current}/bin/print_current) - skip_count=$(${pkgs.attr}/bin/getfattr -n user.skip_count --only-values "$current_track" || echo 0) + skip_count=$(${pkgs.attr}/bin/getfattr -n user.skip_count --only-values "$music_dir"/"$current_track" || echo 0) if [ "$skip_count" -gt 2 ]; then mv "$music_dir"/"$current_track" "$music_dir"/.graveyard/ echo killing: "$track_infos" @@ -193,11 +193,15 @@ in { }; }; + # allow reaktor2 to modify files + systemd.services."reaktor2-the_playlist".serviceConfig.DynamicUser = mkForce false; + krebs.reaktor2.the_playlist = { hostname = "irc.freenode.org"; port = "6697"; useTLS = true; nick = "the_playlist"; + username = "radio"; plugins = [ { plugin = "register"; @@ -214,8 +218,8 @@ in { workdir = config.krebs.reaktor2.the_playlist.stateDir; hooks.PRIVMSG = [ { - #activate = "match"; - pattern = "^\\s*([0-9A-Za-z._][0-9A-Za-z._-]*)(?:\\s+(.*\\S))?\\s*$"; + activate = "match"; + pattern = "^(?:.*\\s)?\\s*the_playlist:\\s*([0-9A-Za-z._][0-9A-Za-z._-]*)(?:\\s+(.*\\S))?\\s*$"; command = 1; arguments = [2]; commands = { -- cgit v1.2.3 From 0578d851885e59b317d653982b7b74f10739b9f3 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 8 Apr 2020 12:33:08 +0200 Subject: syncthing: use upstream module --- krebs/3modules/default.nix | 1 - krebs/3modules/syncthing.nix | 206 -------------------------------------- lass/1systems/mors/config.nix | 8 +- lass/1systems/xerxes/config.nix | 4 +- lass/2configs/green-host.nix | 2 +- lass/2configs/radio.nix | 4 +- lass/2configs/sync/decsync.nix | 4 +- lass/2configs/sync/weechat.nix | 2 +- lass/2configs/syncthing.nix | 16 +-- lass/2configs/websites/domsen.nix | 6 +- 10 files changed, 24 insertions(+), 229 deletions(-) delete mode 100644 krebs/3modules/syncthing.nix diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 6f06f4510..aa06a883d 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -50,7 +50,6 @@ let ./secret.nix ./setuid.nix ./shadow.nix - ./syncthing.nix ./tinc.nix ./tinc_graphs.nix ./urlwatch.nix diff --git a/krebs/3modules/syncthing.nix b/krebs/3modules/syncthing.nix deleted file mode 100644 index 799ed7eda..000000000 --- a/krebs/3modules/syncthing.nix +++ /dev/null @@ -1,206 +0,0 @@ -{ config, pkgs, ... }: with import ; - -let - - kcfg = config.krebs.syncthing; - scfg = config.services.syncthing; - - devices = mapAttrsToList (name: peer: { - name = name; - deviceID = peer.id; - addresses = peer.addresses; - }) kcfg.peers; - - folders = mapAttrsToList ( _: folder: { - inherit (folder) path id type; - devices = map (peer: { deviceId = kcfg.peers.${peer}.id; }) folder.peers; - rescanIntervalS = folder.rescanInterval; - fsWatcherEnabled = folder.watch; - fsWatcherDelayS = folder.watchDelay; - ignoreDelete = folder.ignoreDelete; - ignorePerms = folder.ignorePerms; - }) kcfg.folders; - - getApiKey = pkgs.writeDash "getAPIKey" '' - ${pkgs.libxml2}/bin/xmllint \ - --xpath 'string(configuration/gui/apikey)'\ - ${scfg.configDir}/config.xml - ''; - - updateConfig = pkgs.writeDash "merge-syncthing-config" '' - set -efu - - # XXX this assumes the GUI address to be "IPv4 address and port" - host=${shell.escape (elemAt (splitString ":" scfg.guiAddress) 0)} - port=${shell.escape (elemAt (splitString ":" scfg.guiAddress) 1)} - - # wait for service to restart - ${pkgs.untilport}/bin/untilport "$host" "$port" - - API_KEY=$(${getApiKey}) - - _curl() { - ${pkgs.curl}/bin/curl \ - -Ss \ - -H "X-API-Key: $API_KEY" \ - "http://$host:$port/rest""$@" - } - - old_config=$(_curl /system/config) - new_config=${shell.escape (toJSON { - inherit devices folders; - })} - new_config=$(${pkgs.jq}/bin/jq -en \ - --argjson old_config "$old_config" \ - --argjson new_config "$new_config" \ - ' - $old_config * $new_config - ${optionalString (!kcfg.overridePeers) '' - * { devices: $old_config.devices } - ''} - ${optionalString (!kcfg.overrideFolders) '' - * { folders: $old_config.folders } - ''} - ' - ) - echo $new_config | _curl /system/config -d @- - _curl /system/restart -X POST - ''; - -in - -{ - options.krebs.syncthing = { - - enable = mkEnableOption "syncthing-init"; - - cert = mkOption { - type = types.nullOr types.absolute-pathname; - default = null; - }; - - key = mkOption { - type = types.nullOr types.absolute-pathname; - default = null; - }; - - overridePeers = mkOption { - type = types.bool; - default = true; - description = '' - Whether to delete the peers which are not configured via the peers option - ''; - }; - peers = mkOption { - default = {}; - type = types.attrsOf (types.submodule ({ - options = { - - # TODO make into addr + port submodule - addresses = mkOption { - type = types.listOf types.str; - default = []; - }; - - #TODO check - id = mkOption { - type = types.str; - }; - - }; - })); - }; - - overrideFolders = mkOption { - type = types.bool; - default = true; - description = '' - Whether to delete the folders which are not configured via the peers option - ''; - }; - folders = mkOption { - default = {}; - type = types.attrsOf (types.submodule ({ config, ... }: { - options = { - - path = mkOption { - type = types.absolute-pathname; - default = config._module.args.name; - }; - - id = mkOption { - type = types.str; - default = config._module.args.name; - }; - - peers = mkOption { - type = types.listOf types.str; - default = []; - }; - - rescanInterval = mkOption { - type = types.int; - default = 3600; - }; - - type = mkOption { - type = types.enum [ "sendreceive" "sendonly" "receiveonly" ]; - default = "sendreceive"; - }; - - watch = mkOption { - type = types.bool; - default = true; - }; - - watchDelay = mkOption { - type = types.int; - default = 10; - }; - - ignoreDelete = mkOption { - type = types.bool; - default = false; - }; - - ignorePerms = mkOption { - type = types.bool; - default = true; - }; - - }; - })); - }; - }; - - config = mkIf kcfg.enable { - - systemd.services.syncthing = mkIf (kcfg.cert != null || kcfg.key != null) { - serviceConfig.PermissionsStartOnly = mkDefault true; - preStart = '' - ${optionalString (kcfg.cert != null) '' - cp ${toString kcfg.cert} ${scfg.configDir}/cert.pem - chown ${scfg.user}:${scfg.group} ${scfg.configDir}/cert.pem - chmod 400 ${scfg.configDir}/cert.pem - ''} - ${optionalString (kcfg.key != null) '' - cp ${toString kcfg.key} ${scfg.configDir}/key.pem - chown ${scfg.user}:${scfg.group} ${scfg.configDir}/key.pem - chmod 400 ${scfg.configDir}/key.pem - ''} - ''; - }; - - systemd.services.syncthing-init = { - after = [ "syncthing.service" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - User = scfg.user; - RemainAfterExit = true; - Type = "oneshot"; - ExecStart = updateConfig; - }; - }; - }; -} diff --git a/lass/1systems/mors/config.nix b/lass/1systems/mors/config.nix index 03ff42132..fe0b6d85b 100644 --- a/lass/1systems/mors/config.nix +++ b/lass/1systems/mors/config.nix @@ -49,17 +49,17 @@ with import ; ]; } { - krebs.syncthing = { - peers.schasch.addresses = [ "schasch.r:22000" ]; + services.syncthing.declarative = { + devices.schasch.addresses = [ "schasch.r:22000" ]; folders = { the_playlist = { path = "/home/lass/tmp/the_playlist"; - peers = [ "mors" "phone" "prism" "xerxes" ]; + devices = [ "mors" "phone" "prism" "xerxes" ]; }; free_music = { id = "mu9mn-zgvsw"; path = "/home/lass/tmp/free_music"; - peers = [ "mors" "schasch" ]; + devices = [ "mors" "schasch" ]; }; }; }; diff --git a/lass/1systems/xerxes/config.nix b/lass/1systems/xerxes/config.nix index 8630d0f4b..e4a4fb505 100644 --- a/lass/1systems/xerxes/config.nix +++ b/lass/1systems/xerxes/config.nix @@ -41,11 +41,11 @@ displayManager.lightdm.autoLogin.user = "lass"; }; - krebs.syncthing = { + services.syncthing.declarative = { folders = { the_playlist = { path = "/home/lass/tmp/the_playlist"; - peers = [ "mors" "phone" "prism" "xerxes" ]; + devices = [ "mors" "phone" "prism" "xerxes" ]; }; }; }; diff --git a/lass/2configs/green-host.nix b/lass/2configs/green-