feat(wrappers): start wrapping configs

thanks to @fdncred for the ls function with nushell
This commit is contained in:
Artur Manuel 2025-01-31 21:38:32 +00:00
commit c4a290ae63
13 changed files with 136 additions and 26 deletions

View file

@ -0,0 +1,37 @@
{
symlinkJoin,
waybar,
makeWrapper,
runCommand,
sass,
}: let
styleCss =
runCommand "style.css" {
nativeBuildInputs = [sass];
} ''
sass ${./style.scss} > $out
'';
in
symlinkJoin {
name = "waybar";
paths = [
waybar
];
nativeBuildInputs = [
makeWrapper
];
postBuild = ''
wrapProgram $out/bin/waybar \
--add-flags "--config" \
--add-flags "${./config.jsonc}" \
--add-flags "--style" \
--add-flags "${styleCss}"
rm $out/lib/systemd/user/waybar.service
substitute ${waybar}/lib/systemd/user/waybar.service $out/lib/systemd/user/waybar.service \
--replace-fail ${waybar}/bin/waybar $out/bin/waybar \
'';
meta = {
inherit (waybar.meta) mainProgram;
};
}