feat(taffybar): build against local vendored packages

This commit is contained in:
2026-03-10 14:12:36 -07:00
committed by Kat Huang
parent 0ce93be240
commit df2f78d374
8 changed files with 234 additions and 149 deletions

View File

@@ -1,3 +1,9 @@
packages:
.
taffybar/
taffybar/packages/gtk-scaling-image
taffybar/packages/gtk-sni-tray
taffybar/packages/gtk-strut
taffybar/packages/status-notifier-item
taffybar/packages/dbus-menu
taffybar/packages/dbus-hslogger

View File

@@ -288,8 +288,8 @@
"xmonad-contrib": "xmonad-contrib"
},
"locked": {
"lastModified": 1772654806,
"narHash": "sha256-Z0ULX5RfYRSiebBEUJ9o9m6FKtx2bLYgO47L5zCUDM8=",
"lastModified": 1773126540,
"narHash": "sha256-EgqWupeQv8j5Rt+Kl7D/X+8LkI6i2qygpafMDFXpOY4=",
"path": "/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar",
"type": "path"
},

View File

@@ -82,11 +82,15 @@
# Exclude local worktree/build artifacts from the source we feed to
# callCabal2nix. cleanSource alone still includes .worktrees/.
# Use the live local checkout directly so Nix picks up dirty nested-repo
# changes while iterating on the vendored taffybar stack.
localTaffybarCheckout = /home/imalison/dotfiles/dotfiles/config/taffybar/taffybar;
cleanedTaffybarSource = pkgs.lib.cleanSourceWith {
src = taffybar.outPath;
src = localTaffybarCheckout;
filter = path: type:
let
relPath = pkgs.lib.removePrefix "${toString taffybar.outPath}/" (toString path);
relPath = pkgs.lib.removePrefix "${toString localTaffybarCheckout}/" (toString path);
excludedTopLevel = [ ".worktrees" ".direnv" "dist" "dist-newstyle" "result" ];
isExcluded = pkgs.lib.lists.any
(prefix: relPath == prefix || pkgs.lib.hasPrefix "${prefix}/" relPath)
@@ -95,11 +99,13 @@
pkgs.lib.cleanSourceFilter path type && !isExcluded;
};
localTaffybarSubdir = subdir: cleanedTaffybarSource + "/${subdir}";
hOverrides = hself: hsuper: {
dbus-menu =
pkgs.haskell.lib.overrideCabal
(hself.callCabal2nix "dbus-menu"
(pkgs.lib.cleanSource (dbus-menu.outPath or dbus-menu))
(localTaffybarSubdir "packages/dbus-menu")
{ inherit (pkgs) gtk3; })
(_: {
doCheck = false;
@@ -111,27 +117,34 @@
status-notifier-item =
pkgs.haskell.lib.overrideCabal
(hself.callCabal2nix "status-notifier-item"
(pkgs.lib.cleanSource status-notifier-item.outPath)
(localTaffybarSubdir "packages/status-notifier-item")
{ })
(_: { doCheck = false; doHaddock = false; });
gtk-scaling-image =
pkgs.haskell.lib.overrideCabal
(hself.callCabal2nix "gtk-scaling-image"
(localTaffybarSubdir "packages/gtk-scaling-image")
{ })
(_: { doCheck = false; doHaddock = false; });
gtk-strut =
pkgs.haskell.lib.overrideCabal
(hself.callCabal2nix "gtk-strut"
(pkgs.lib.cleanSource gtk-strut.outPath)
(localTaffybarSubdir "packages/gtk-strut")
{ })
(_: { doCheck = false; doHaddock = false; });
gtk-sni-tray =
pkgs.haskell.lib.overrideCabal
(hself.callCabal2nix "gtk-sni-tray"
(pkgs.lib.cleanSource gtk-sni-tray.outPath)
(localTaffybarSubdir "packages/gtk-sni-tray")
{ })
(_: { doCheck = false; doHaddock = false; });
dbus-hslogger =
hself.callCabal2nix "dbus-hslogger"
(pkgs.lib.cleanSource (dbus-hslogger.outPath or dbus-hslogger))
(localTaffybarSubdir "packages/dbus-hslogger")
{ };
# Build taffybar from our local flake input so it includes our extra

View File

@@ -24,6 +24,7 @@ executable taffybar
, gi-gdk3
, gi-gtk3
, gi-gdkpixbuf
, gi-pango
, gtk-sni-tray
, gtk-strut
, haskell-gi-base

View File

@@ -506,16 +506,15 @@ sunLockWidget =
cpuWidget :: TaffyIO Gtk.Widget
cpuWidget =
decorateWithClassAndBoxM "cpu" $
liftIO $
cpuMonitorNew
defaultGraphConfig
{ graphDataColors = [(0, 1, 0.5, 0.8), (1, 0, 0, 0.5)],
graphLabel = Just "CPU",
graphWidth = 50,
graphDirection = LEFT_TO_RIGHT
}
1.0
"cpu"
cpuMonitorNew
defaultGraphConfig
{ graphDataColors = [(0, 1, 0.5, 0.8), (1, 0, 0, 0.5)],
graphLabel = Just "CPU",
graphWidth = 50,
graphDirection = LEFT_TO_RIGHT
}
1.0
"cpu"
wakeupDebugWidget :: TaffyIO Gtk.Widget
wakeupDebugWidget =