Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asdbctl: init at 1.0.0 #392023

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions pkgs/by-name/as/asdbctl/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
pkg-config,
udev,
}:

rustPlatform.buildRustPackage (finalAttrs: {
pname = "asdbctl";
version = "1.0.0";

src = fetchFromGitHub {
owner = "juliuszint";
repo = "asdbctl";
tag = "v${finalAttrs.version}";
hash = "sha256-S5m1iQlchGKc0PODQNDHpNzaNXRepmk5zfK5aXdiMiM=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-OPmnGh6xN6XeREeIgyYB2aeHUpdQ5hFS5MivcTeY29E=";

nativeBuildInputs = [
pkg-config
];

buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
udev
];

postInstall = ''
install -Dm444 \
rules.d/20-asd-backlight.rules \
$out/lib/udev/rules.d/20-asd-backlight.rules
'';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding a version check would be good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the program does not seem to have any way to output the version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the version check will use --help by default which this program does have

Copy link
Contributor Author

@danieldk danieldk Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But --help doesn’t list the version, so the check would fail?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah your right

meta = {
description = "Apple Studio Display brightness controll";
mainProgram = "asdbctl";
homepage = "https://github.com/juliuszint/asdbctl";
changelog = "https://github.com/juliuszint/asdbctl/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = [
lib.maintainers.danieldk
];
};
})