# Credit to github:misterio77/nix-colors { pkgs, config, hozen, }: let inherit (config.ooknet.hardware) monitors; inherit (hozen) color; 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, logoScale ? 4, backgroundColor ? color.layout.body, logoColor1 ? color.green.base, logoColor2 ? color.yellow.base, }: pkgs.stdenv.mkDerivation { name = "generated-nix-wallpaper-${color.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"; }