nixos: use hozen colors for generated wallpaper

This commit is contained in:
ooks-io 2024-11-19 17:13:59 +11:00
parent 151da369a0
commit 7a4216ae43
2 changed files with 10 additions and 17 deletions

View file

@ -2,9 +2,10 @@
{
pkgs,
config,
hozen,
}: let
inherit (config.ooknet.hardware) monitors;
inherit (config.ooknet.appearance) colorscheme;
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;
@ -13,21 +14,17 @@ in
width ? largestWidth,
height ? largestHeight,
logoScale ? 4,
backgroundColor ? colorscheme.palette.mantle,
logoColor1 ? colorscheme.palette.yellow,
logoColor2 ? colorscheme.palette.green,
backgroundColor ? color.layout.body,
logoColor1 ? color.green.base,
logoColor2 ? color.yellow.base,
}:
pkgs.stdenv.mkDerivation {
name = "generated-nix-wallpaper-${colorscheme.slug}.png";
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 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">

View file

@ -2,11 +2,12 @@
config,
lib,
pkgs,
hozen,
...
}: let
inherit (lib) mkIf;
inherit (config.ooknet.workstation) theme;
generatedWallpaper = import ./generated-wallpaper.nix {inherit config pkgs;} {};
generatedWallpaper = import ./generated-wallpaper.nix {inherit hozen config pkgs;} {};
in {
config = mkIf (theme == "minimal") {
ooknet.appearance = {
@ -30,11 +31,6 @@ in {
wallpaper = {
path = "${generatedWallpaper}";
};
colorscheme = {
name = "gruvbox-material";
variant = "dark";
};
};
};
}