From 297da4a3ff93b73b6a686e6814799e37a5aa071c Mon Sep 17 00:00:00 2001 From: Vikingnope Date: Mon, 22 Dec 2025 23:16:10 +0100 Subject: [PATCH] vscode: add hicolor icon --- pkgs/applications/editors/vscode/generic.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index 3d2c931a4591..1c22a86b7dac 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -57,6 +57,7 @@ ripgrep, hasVsceSign ? false, patchVSCodePath ? true, + imagemagick, }: stdenv.mkDerivation ( @@ -249,6 +250,7 @@ stdenv.mkDerivation ( nativeBuildInputs = [ unzip + imagemagick ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook @@ -289,7 +291,13 @@ stdenv.mkDerivation ( # These are named vscode.png, vscode-insiders.png, etc to match the name in upstream *.deb packages. + '' mkdir -p "$out/share/pixmaps" - cp "$out/lib/${libraryName}/resources/app/resources/linux/code.png" "$out/share/pixmaps/${iconName}.png" + icon_file="$out/lib/${libraryName}/resources/app/resources/linux/code.png" + cp "$icon_file" "$out/share/pixmaps/${iconName}.png" + + # Dynamically determine size of icon and place in appropriate directory + size=$(identify -format "%wx%h" "$icon_file") + mkdir -p "$out/share/icons/hicolor/$size/apps" + cp "$icon_file" "$out/share/icons/hicolor/$size/apps/${iconName}.png" '' ) # Override the previously determined VSCODE_PATH with the one we know to be correct