From deebf9d077c4dc50ddb9564dfccd4f31a7afdf80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sat, 22 Mar 2025 08:25:16 +0100 Subject: [PATCH] asdbctl: init at 1.0.0 This is a utility to control brightness on Apple Studio Displays. --- pkgs/by-name/as/asdbctl/package.nix | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 pkgs/by-name/as/asdbctl/package.nix diff --git a/pkgs/by-name/as/asdbctl/package.nix b/pkgs/by-name/as/asdbctl/package.nix new file mode 100644 index 0000000000000..d6edeff45b598 --- /dev/null +++ b/pkgs/by-name/as/asdbctl/package.nix @@ -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 + ''; + + 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 + ]; + }; +})