nixpkgs/pkgs/by-name/ew/eww/package.nix
Alyssa Ross 63bff8c132
treewide: migrate to fetchCargoVendor, batch 1
Cargo 1.84.0 seems to have changed the output format of cargo vendor
again, once again invalidating fetchCargoTarball FOD hashes.  It's
time to fix this once and for all, switching across the board to
fetchCargoVendor, which is not dependent on cargo vendor's output
format.

It should be possible to reproduce this diff.  To do so, get the list
of files changed by this commit, e.g. with git diff --name-only, then
run the following two commands, each with that list of files as their
standard input:

	xargs sed -i 's/^\(. *\)\(cargoHash\)\b/\1useFetchCargoVendor = true;\n\1cargoHash/'
	cut -d / -f 4 | xargs -n 1 nix-update --version=skip

This will take a long time.  It might be possible to parallelize it
using xargs' -P option.  I haven't tested it.
2025-01-23 11:46:43 +01:00

83 lines
2.0 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
pkg-config,
wrapGAppsHook3,
gtk3,
librsvg,
gtk-layer-shell,
stdenv,
libdbusmenu-gtk3,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "eww";
version = "0.6.0-unstable-2025-01-14";
src = fetchFromGitHub {
owner = "elkowar";
repo = "eww";
rev = "593a4f4666f0bc42790d6d033e64a2b38449090f";
hash = "sha256-DbXsiqMyZKNSFmL5aEJwJr+cPnz8qaWe5lNDoovOX/g=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-JBX6jyqzkbqnpA/P2BJ04UHTU6lWbMUcD2uMUJPblvc=";
nativeBuildInputs = [
installShellFiles
pkg-config
wrapGAppsHook3
];
buildInputs = [
gtk3
gtk-layer-shell
libdbusmenu-gtk3
librsvg
];
cargoBuildFlags = [
"--bin"
"eww"
];
cargoTestFlags = cargoBuildFlags;
# requires unstable rust features
RUSTC_BOOTSTRAP = 1;
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd eww \
--bash <($out/bin/eww shell-completions --shell bash) \
--fish <($out/bin/eww shell-completions --shell fish) \
--zsh <($out/bin/eww shell-completions --shell zsh)
'';
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
meta = {
description = "Widget system made in Rust to create widgets for any WM";
longDescription = ''
Eww (ElKowar's Wacky Widgets) is a widget system made in Rust which lets
you create your own widgets similarly to how you can in AwesomeWM.
The key difference: It is independent of your window manager!
It can be configured in yuck and themed using CSS, is very easy
to customize and provides all the flexibility you need!
'';
homepage = "https://github.com/elkowar/eww";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
coffeeispower
figsoda
lom
w-lfchen
];
mainProgram = "eww";
broken = stdenv.hostPlatform.isDarwin;
};
}