From 842d69961fd3c79f8640a9d2c8a26f224b765860 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 29 Dec 2025 14:16:06 +0100 Subject: [PATCH] xrizer: refactor platforms This avoids repeating the platform list Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/xr/xrizer/package.nix | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/xr/xrizer/package.nix b/pkgs/by-name/xr/xrizer/package.nix index fd8cdf9a12fb..4938567012b6 100644 --- a/pkgs/by-name/xr/xrizer/package.nix +++ b/pkgs/by-name/xr/xrizer/package.nix @@ -12,6 +12,13 @@ vulkan-loader, stdenv, }: +let + platformPaths = { + "aarch64-linux" = "bin/linuxarm64"; + "i686-linux" = "bin"; + "x86_64-linux" = "bin/linux64"; + }; +in rustPlatform.buildRustPackage rec { pname = "xrizer"; version = "0.4"; @@ -58,13 +65,7 @@ rustPlatform.buildRustPackage rec { mv "$out/lib/libxrizer.so" "$out/lib/xrizer/$platformPath/vrclient.so" ''; - platformPath = - { - "aarch64-linux" = "bin/linuxarm64"; - "i686-linux" = "bin"; - "x86_64-linux" = "bin/linux64"; - } - ."${stdenv.hostPlatform.system}"; + platformPath = platformPaths."${stdenv.hostPlatform.system}"; passthru.updateScript = nix-update-script { }; @@ -73,10 +74,6 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/Supreeeme/xrizer"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ Scrumplex ]; - platforms = [ - "x86_64-linux" - "i686-linux" - "aarch64-linux" - ]; + platforms = builtins.attrNames platformPaths; }; }