2021-12-14 15:06:13 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-05-06 00:09:46 +00:00
|
|
|
stdenv,
|
2021-12-14 15:06:13 +00:00
|
|
|
fetchFromGitHub,
|
|
|
|
makeWrapper,
|
|
|
|
rustPlatform,
|
2024-05-06 00:09:46 +00:00
|
|
|
marked-man,
|
|
|
|
coreutils,
|
2021-12-14 15:06:13 +00:00
|
|
|
vulkan-loader,
|
2023-04-16 08:50:45 +00:00
|
|
|
wayland,
|
2022-01-15 03:28:51 +00:00
|
|
|
pkg-config,
|
|
|
|
udev,
|
|
|
|
v4l-utils,
|
2024-05-14 16:37:09 +00:00
|
|
|
dbus,
|
2024-05-14 16:31:18 +00:00
|
|
|
nix-update-script,
|
2021-12-14 15:06:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wluma";
|
2024-11-18 12:31:54 +00:00
|
|
|
version = "4.5.1";
|
2021-12-14 15:06:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "maximbaz";
|
|
|
|
repo = "wluma";
|
|
|
|
rev = version;
|
2024-11-18 12:31:54 +00:00
|
|
|
sha256 = "sha256-5uSExmh1a88kZDly4VrHzI8YwfTDB8wm2mMGZyvKsk4=";
|
2021-12-14 15:06:13 +00:00
|
|
|
};
|
|
|
|
|
2024-05-06 00:09:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace \
|
|
|
|
'target/release/$(BIN)' \
|
|
|
|
'target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/$(BIN)'
|
|
|
|
|
|
|
|
# Needs chmod and chgrp
|
|
|
|
substituteInPlace 90-wluma-backlight.rules --replace \
|
|
|
|
'RUN+="/bin/' 'RUN+="${coreutils}/bin/'
|
|
|
|
|
|
|
|
substituteInPlace wluma.service --replace \
|
|
|
|
'ExecStart=/usr/bin/wluma' 'ExecStart=${placeholder "out"}/bin/wluma'
|
|
|
|
'';
|
|
|
|
|
2024-11-18 12:31:54 +00:00
|
|
|
cargoHash = "sha256-hKxKEs88tB05AiWC/LuC/0jJ1RxeUnpp35A6UTQK4xw=";
|
2022-07-08 14:44:08 +00:00
|
|
|
|
2022-01-15 03:28:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
2022-02-13 12:00:00 +00:00
|
|
|
rustPlatform.bindgenHook
|
2024-05-06 00:09:46 +00:00
|
|
|
marked-man
|
2022-01-15 03:28:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
udev
|
2022-02-13 12:00:00 +00:00
|
|
|
v4l-utils
|
2023-04-16 08:50:45 +00:00
|
|
|
vulkan-loader
|
2024-05-14 16:37:09 +00:00
|
|
|
dbus
|
2022-01-15 03:28:51 +00:00
|
|
|
];
|
|
|
|
|
2024-05-06 00:09:46 +00:00
|
|
|
postBuild = ''
|
|
|
|
make docs
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontCargoInstall = true;
|
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
2021-12-14 15:06:13 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/wluma \
|
2023-04-16 08:50:45 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ wayland ]}"
|
2021-12-14 15:06:13 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-14 16:31:18 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2021-12-14 15:06:13 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Automatic brightness adjustment based on screen contents and ALS";
|
|
|
|
homepage = "https://github.com/maximbaz/wluma";
|
2023-04-16 08:50:45 +00:00
|
|
|
changelog = "https://github.com/maximbaz/wluma/releases/tag/${version}";
|
2021-12-14 15:06:13 +00:00
|
|
|
license = licenses.isc;
|
2024-05-14 16:51:17 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
yshym
|
|
|
|
jmc-figueira
|
|
|
|
atemu
|
|
|
|
];
|
2021-12-14 15:06:13 +00:00
|
|
|
platforms = platforms.linux;
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "wluma";
|
2021-12-14 15:06:13 +00:00
|
|
|
};
|
|
|
|
}
|