This repository has no description
1.9 kB
53 lines
1{
2 perSystem =
3 { pkgs, self', ... }:
4 let
5 python = pkgs.python3.withPackages (
6 ps: with ps; [
7 astropy
8 numpy
9 pillow
10 ]
11 );
12 constellations = pkgs.fetchurl {
13 url = "https://raw.githubusercontent.com/ofrohn/d3-celestial/7e720a3de062059d4c5400a379146a601d9010e0/data/constellations.lines.json";
14 hash = "sha256-KU9mvvXVz1Cx4X8W0u+h2XoVExYSxo3ZNa3vbnNz4Tw=";
15 };
16 krebsIcon =
17 pkgs.runCommand "krebs.png"
18 {
19 nativeBuildInputs = [ pkgs.librsvg ];
20 src = pkgs.fetchurl {
21 url = "https://raw.githubusercontent.com/krebs/painload/25bb340f4d8d05bb3ab6792277951b77923e7010/cholerab/bling/krebs_aquarium.svg";
22 hash = "sha256-KLoY58M3bPcI0WrqomPbDNewKz+akeR0oujccDeUqnY=";
23 };
24 }
25 ''
26 rsvg-convert -w 64 -h 64 "$src" -o "$out"
27 '';
28 in
29 {
30 packages.realwallpaper =
31 (pkgs.writeShellApplication {
32 name = "realwallpaper";
33 runtimeInputs = [ python ];
34 text = ''
35 export REALWALLPAPER_CONSTELLATIONS=${constellations}
36 export REALWALLPAPER_KREBS_ICON=${krebsIcon}
37 export REALWALLPAPER_FONT=${pkgs.dejavu_fonts}/share/fonts/truetype/DejaVuSans.ttf
38 exec python3 ${./realwallpaper.py} "$@"
39 '';
40 }).overrideAttrs
41 { passthru.usage = builtins.readFile ./usage.kdl; };
42
43 packages.realwallpaper-server =
44 (pkgs.writeShellApplication {
45 name = "realwallpaper-server";
46 runtimeInputs = [ pkgs.python3 ];
47 text = ''
48 exec python3 ${./server.py} --realwallpaper ${self'.packages.realwallpaper}/bin/realwallpaper "$@"
49 '';
50 }).overrideAttrs
51 { passthru.usage = builtins.readFile ./server-usage.kdl; };
52 };
53}