add wallpaper that gets recolored v2 and actually works now

This commit is contained in:
lucy 2026-08-05 17:07:48 +02:00
commit 81e47e6467
2 changed files with 19 additions and 15 deletions

View file

@ -1,10 +1,15 @@
{
lib,
pkgs,
config,
inputs,
...
}:
let
palette = lib.strings.removePrefix "${pkgs.base16-schemes}/share/themes/" "${config.stylix.base16Scheme
}";
cleanPalette = lib.strings.removeSuffix ".yaml" "${palette}";
in
{
imports = [
./stylix.nix
@ -23,6 +28,9 @@
home.homeDirectory = "/home/lucy";
home.stateVersion = "26.05";
home.activation = {
wallpaper = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${lib.getExe pkgs.lutgen} apply ${config.stylix.image} -p ${cleanPalette} -o ~/.walls/a.png
'';
reload-quickshell =
lib.hm.dag.entryAfter
[
@ -30,6 +38,8 @@
]
''
${lib.getExe pkgs.quickshell} ipc call config reload true
${lib.getExe pkgs.quickshell} ipc call config setWall ~/.walls/a.png
'';
};
}

View file

@ -2,7 +2,6 @@
inputs,
pkgs,
lib,
config,
...
}:
let
@ -27,18 +26,13 @@ let
map (n: "${dir}/${n}/${platform}.nix") (
builtins.filter (n: builtins.pathExists "${dir}/${n}/${platform}.nix") drop
);
wallpaper = ./wallpaper.png;
baseNames = map (c: "base0${c}") (lib.stringToCharacters "0123456789ABCDEF");
palette = lib.concatMapStringsSep " " (n: config.lib.stylix.colors.withHashtag.${n}) baseNames;
palette = "gruvbox-dark-hard";
stylixPalette = lib.strings.concatStrings [
"${pkgs.base16-schemes}/share/themes/"
"${palette}"
".yaml"
];
recolored =
pkgs.runCommand "wallpaper-stylix.png"
{
nativeBuildInputs = [ pkgs.lutgen ];
}
''
lutgen apply ${wallpaper} -o ~/.walls/stylix-bars.png -p ${palette}
'';
in
{
disabledModules = disable "nixos";
@ -62,9 +56,9 @@ in
stylix = {
enable = true;
autoEnable = false;
base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyodark.yaml";
base16Scheme = stylixPalette;
polarity = "dark";
image = recolored;
image = ./wallpaper.png;
targets = {
console.enable = true;
gtk.enable = true;