{ pkgs, config, }: let inherit (config.ooknet.hardware) monitors; inherit (config.ooknet.appearance) colorscheme; largest = f: xs: builtins.head (builtins.sort (a: b: a > b) (map f xs)); largestWidth = largest (x: x.width) monitors; largestHeight = largest (x: x.height) monitors; in { width ? largestWidth, height ? largestHeight, }: # Credit to misterio77 pkgs.stdenv.mkDerivation { name = "generated-nix-wallpaper-${colorscheme.slug}.png"; src = pkgs.writeTextFile { name = "template.svg"; text = '' ''; }; buildInputs = [pkgs.inkscape]; unpackPhase = "true"; buildPhase = '' inkscape --export-type="png" $src -w ${toString width} -h ${toString height} -o wallpaper.png ''; installPhase = "install -Dm0644 wallpaper.png $out"; }