37 lines
799 B
Nix
37 lines
799 B
Nix
{
|
|
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;
|
|
};
|
|
}
|