feat(wrapping): introduce wrapped configurations
This commit is contained in:
parent
3892f6f79b
commit
2aa24ab2b9
22 changed files with 883 additions and 135 deletions
36
hosts/python/users/waybar.nix
Normal file
36
hosts/python/users/waybar.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
symlinkJoin,
|
||||
waybar,
|
||||
makeWrapper,
|
||||
runCommand,
|
||||
sass,
|
||||
}: let
|
||||
styleCss =
|
||||
runCommand "style.css" {
|
||||
nativeBuildInputs = [sass];
|
||||
} ''
|
||||
sass ${./configs/waybar/style.scss} > $out
|
||||
'';
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "waybar";
|
||||
paths = [
|
||||
waybar
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/waybar \
|
||||
--add-flags "--config" \
|
||||
--add-flags "${./configs/waybar/config.jsonc}" \
|
||||
--add-flags "--style" \
|
||||
--add-flags "${styleCss}"
|
||||
|
||||
substitute ${waybar}/lib/systemd/user/waybar.service $out/lib/systemd/user/waybar-wrapped.service \
|
||||
--replace-fail ${waybar}/bin/waybar $out/bin/waybar
|
||||
'';
|
||||
meta = {
|
||||
inherit (waybar.meta) mainProgram;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue