finalise wallpaper

This commit is contained in:
atagen 2023-09-29 00:37:32 +10:00
parent ef0c9157f4
commit eabb1371eb
12 changed files with 217 additions and 25 deletions

View file

@ -9,8 +9,8 @@ in
src = pkgs.fetchFromGitHub {
owner = "nana-4";
repo = "materia-theme";
rev = "76cac96ca7fe45dc9e5b9822b0fbb5f4cad47984";
sha256 = "sha256-0eCAfm/MWXv6BbCl2vbVbvgv8DiUH09TAUhoKq7Ow0k=";
rev = "6e5850388a25f424b8193fe4523504d1dc364175";
sha256 = "sha256-I6hpH0VTmftU4+/pRbztuTQcBKcOFBFbNZXJL/2bcgU=";
};
buildInputs = with pkgs; [
sassc

View file

@ -90,17 +90,25 @@ in rec {
};
borders = {
thickness = 2;
thickness = 6;
rounding = 0;
gaps_in = 6;
gaps_out = 6;
};
bg = {
image = builtins.path {
name = "wallpaper";
path = ./wallpaper.png;
sha256 = "a98b32664ab456d088225a19c0fc7e672a8fccd6a30129fdb2ff11d25e766b17";
# image = builtins.path rec {
# name = "wallpaper.jpg";
# path = ../${name};
# sha256 = "ec88d7005a97f104784e53ecaef883d33cf53f76cf4a6e89d05980bbc844c772";
# };
image = prev.callPackage ./wallpaper.nix {} {
palette = palette.toRGBShortHex final.rice.palette;
wallpaper = builtins.path rec {
name = "wallpaper.jpg";
path = ../${name};
sha256 = "2db3f9d0397fbd4746ada297bd14c0c7d3e22c7d4e894968fcfece90bbfb902a";
};
};
};
}; # /rice

20
util/wallpaper.nix Normal file
View file

@ -0,0 +1,20 @@
{pkgs}: {
palette,
wallpaper,
}: let
str_pal = with pkgs.lib; concatStringsSep " " (builtins.foldl' (acc: el: acc ++ (attrValues el)) [] [palette.normal palette.bright palette.util]);
in
pkgs.stdenv.mkDerivation rec {
name = "generated-wallpaper.png";
src = wallpaper;
buildInputs = [
pkgs.lutgen
];
phases = ["installPhase"];
installPhase = ''
echo -e "Generating wallpaper from ${wallpaper} using palette:\n${str_pal}.."
${pkgs.lib.getExe pkgs.lutgen} apply --lum 0.8 -l 10 -s 128 -n 8 -o $out ${wallpaper} -- ${str_pal}
'';
}