main @ 48 LINES
[ HISTORY ] [ UP ]
┌─ NIX ──────────────────────────────────────────────────────────────────────┐
│ # Credit to github:misterio77/nix-colors │
│ { │
│ pkgs, │
│ config, │
│ ook, │
│ }: let │
│ inherit (config.ooknet.hardware) monitors; │
│ inherit (ook) 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 = '' │
│ <svg width="${toString width}" height="${toString height}" version="1.1" │
│ xmlns="http://www.w3.org/2000/svg"> │
│ <rect width="${toString width}" height="${toString height}" fill="#${ │
│ backgroundColor}"/> │
│ <svg x="${toString (width / 2 - (logoScale * 50))}" y="${ │
│ toString (height / 2 - (logoScale * 50)) │
│ }" version="1.1" xmlns="http://www.w3.org/2000/svg"> │
│ <g transform="scale(${toString logoScale})"> │
│ <g transform="matrix(.19936 0 0 .19936 80.161 27.828)"> │
│ <path d="m-53.275 105.84-122.2-211.68 56.157-0.5268 32.624 56.8 │
│ 69 32.856-56.565 27.902 0.011 14.291 24.69-46.81 80.49 33.229 57.826zm-142.26 92.7 │
│ 48 244.42 0.012-27.622 48.897-65.562-0.1813 32.559 56.737-13.961 24.158-28.528 0.0 │
│ 31-46.301-80.784-66.693-0.1359zm-9.3752-169.2-122.22 211.67-28.535-48.37 32.938-56 │
│ .688-65.415-0.1717-13.942-24.169 14.237-24.721 93.111 0.2937 33.464-57.69z" fill=" │
│ #${logoColor1}"/> │
│ <path d="m-97.659 193.01 122.22-211.67 28.535 48.37-32.938 56.6 │
│ 88 65.415 0.1716 13.941 24.169-14.237 24.721-93.111-0.2937-33.464 57.69zm-9.5985-1 │
│ 69.65-244.42-0.012 27.622-48.897 65.562 0.1813-32.559-56.737 13.961-24.158 28.528- │
│ 0.031 46.301 80.784 66.693 0.1359zm-141.76 93.224 122.2 211.68-56.157 0.5268-32.62 │
│ 4-56.869-32.856 56.565-27.902-0.011-14.291-24.69 46.81-80.49-33.229-57.826z" fill= │
│ "#${logoColor2}" style="isolation:auto;mix-blend-mode:normal"/> │
│ </g> │
│ </g> │
│ </svg> │
│ </svg> │
│ ''; │
│ }; │
│ buildInputs = [pkgs.inkscape]; │
│ unpackPhase = "true"; │
│ buildPhase = '' │
│ inkscape --export-type="png" $src -w ${toString width} -h ${toString heigh │
│ t} -o wallpaper.png │
│ ''; │
│ installPhase = "install -Dm0644 wallpaper.png $out"; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ NIX ────────────────────────────────┐
│ # Credit to github:misterio77/nix-colors │
│ { │
│ pkgs, │
│ config, │
│ ook, │
│ }: let │
│ inherit (config.ooknet.hardware) monitors; │
│ inherit (ook) color; │
│ largest = f: xs: builtins.head (builtins.s │
│ ort (a: b: a > b) (map f xs)); │
│ largestWidth = largest (x: x.width) monito │
│ rs; │
│ largestHeight = largest (x: x.height) moni │
│ tors; │
│ 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-${colo │
│ r.slug}.png"; │
│ src = pkgs.writeTextFile { │
│ name = "template.svg"; │
│ text = '' │
│ <svg width="${toString width}" hei │
│ ght="${toString height}" version="1.1" xmlns │
│ ="http://www.w3.org/2000/svg"> │
│ <rect width="${toString width}" │
│ height="${toString height}" fill="#${backgr │
│ oundColor}"/> │
│ <svg x="${toString (width / 2 - │
│ (logoScale * 50))}" y="${ │
│ toString (height / 2 - (logoScal │
│ e * 50)) │
│ }" version="1.1" xmlns="http://www │
│ .w3.org/2000/svg"> │
│ <g transform="scale(${toStrin │
│ g logoScale})"> │
│ <g transform="matrix(.19936 │
│ 0 0 .19936 80.161 27.828)"> │
│ <path d="m-53.275 105.84- │
│ 122.2-211.68 56.157-0.5268 32.624 56.869 32. │
│ 856-56.565 27.902 0.011 14.291 24.69-46.81 8 │
│ 0.49 33.229 57.826zm-142.26 92.748 244.42 0. │
│ 012-27.622 48.897-65.562-0.1813 32.559 56.73 │
│ 7-13.961 24.158-28.528 0.031-46.301-80.784-6 │
│ 6.693-0.1359zm-9.3752-169.2-122.22 211.67-28 │
│ .535-48.37 32.938-56.688-65.415-0.1717-13.94 │
│ 2-24.169 14.237-24.721 93.111 0.2937 33.464- │
│ 57.69z" fill="#${logoColor1}"/> │
│ <path d="m-97.659 193.01 │
│ 122.22-211.67 28.535 48.37-32.938 56.688 65. │
│ 415 0.1716 13.941 24.169-14.237 24.721-93.11 │
│ 1-0.2937-33.464 57.69zm-9.5985-169.65-244.42 │
│ -0.012 27.622-48.897 65.562 0.1813-32.559-56 │
│ .737 13.961-24.158 28.528-0.031 46.301 80.78 │
│ 4 66.693 0.1359zm-141.76 93.224 122.2 211.68 │
│ -56.157 0.5268-32.624-56.869-32.856 56.565-2 │
│ 7.902-0.011-14.291-24.69 46.81-80.49-33.229- │
│ 57.826z" fill="#${logoColor2}" style="isolat │
│ ion:auto;mix-blend-mode:normal"/> │
│ </g> │
│ </g> │
│ </svg> │
│ </svg> │
│ ''; │
│ }; │
│ buildInputs = [pkgs.inkscape]; │
│ unpackPhase = "true"; │
│ buildPhase = '' │
│ inkscape --export-type="png" $src -w │
│ ${toString width} -h ${toString height} -o │
│ wallpaper.png │
│ ''; │
│ installPhase = "install -Dm0644 wallpa │
│ per.png $out"; │
│ } │
└──────────────────────────────────────────────┘
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET