tuxedo-rs: use finalAttrs pattern and versionCheckHook (#423259)

This commit is contained in:
Aleksana
2025-07-21 10:33:48 +08:00
committed by GitHub
+9 -10
View File
@@ -2,10 +2,9 @@
lib,
fetchFromGitHub,
rustPlatform,
testers,
tuxedo-rs,
versionCheckHook,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "tuxedo-rs";
version = "0.3.1";
@@ -14,7 +13,7 @@ rustPlatform.buildRustPackage rec {
src = fetchFromGitHub {
owner = "AaronErhardt";
repo = "tuxedo-rs";
rev = "tailor-v${version}";
rev = "tailor-v${finalAttrs.version}";
hash = "sha256-+NzwUs8TZsA0us9hI1UmEKdiOo9IqTRmTOHs4xmC7MY=";
};
@@ -24,11 +23,11 @@ rustPlatform.buildRustPackage rec {
useFetchCargoVendor = true;
cargoHash = "sha256-EkTLL7thZ/bBpY7TwfEsPOjJxzQ3vpxDi+sYPNAK6og=";
passthru.tests.version = testers.testVersion {
package = tuxedo-rs;
command = "${meta.mainProgram} --version";
version = version;
};
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
versionCheckProgramArg = "--version";
postInstall = ''
install -Dm444 tailord/com.tux.Tailor.conf -t $out/share/dbus-1/system.d
@@ -52,4 +51,4 @@ rustPlatform.buildRustPackage rec {
platforms = platforms.linux;
mainProgram = "tailor";
};
}
})