From c293ad4c67aeb5b7ff7b5f5325c4c3a2caabb985 Mon Sep 17 00:00:00 2001 From: imnyang Date: Tue, 26 May 2026 09:24:30 +0900 Subject: [PATCH] wow --- flake.nix | 6 +++- pkgs/vscode-insiders/default.nix | 61 +++++++++++++++++++------------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index 2d68e32..7eb0a86 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,11 @@ outputs = { self, nixpkgs }: let - system = "x86_64-linux"; + system = [ + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; # Overlay 정의 overlay = final: prev: { diff --git a/pkgs/vscode-insiders/default.nix b/pkgs/vscode-insiders/default.nix index 4cee7bc..7301371 100644 --- a/pkgs/vscode-insiders/default.nix +++ b/pkgs/vscode-insiders/default.nix @@ -1,50 +1,61 @@ -{ pkgs, lib, fetchTarball }: +{ pkgs, lib, fetchurl }: let inherit (pkgs) stdenv; - sysAttrs = if stdenv.hostPlatform.isDarwin then - if stdenv.hostPlatform.isAarch64 then { - url = "https://code.visualstudio.com/sha/download?build=insider&os=darwin-arm64-dmg"; - sha256 = "sha256-K+U6JtVNz1PRzL/0SIEK7RXwQu6LL3p+248Ywbn+mDc="; - } else { - url = "https://code.visualstudio.com/sha/download?build=insider&os=darwin-x64-dmg"; - sha256 = "sha256-ex0ESS9APZxgc7b96Q7EQbckUXE51LmTqDfsnN07W3I="; - } - else { - url = "https://code.visualstudio.com/sha/download?build=insider&os=linux-x64"; - sha256 = "sha256-kE99FyilwwFv3zTCkufGwD3s1WwoJ2krg10l3Xy5PRE="; - }; + sysAttrs = + if stdenv.hostPlatform.isDarwin then + if stdenv.hostPlatform.isAarch64 then { + url = "https://code.visualstudio.com/sha/download?build=insider&os=darwin-arm64-dmg"; + sha256 = "sha256-K+U6JtVNz1PRzL/0SIEK7RXwQu6LL3p+248Ywbn+mDc="; + } else { + url = "https://code.visualstudio.com/sha/download?build=insider&os=darwin-x64-dmg"; + sha256 = "sha256-ex0ESS9APZxgc7b96Q7EQbckUXE51LmTqDfsnN07W3I="; + } + else { + url = "https://code.visualstudio.com/sha/download?build=insider&os=linux-x64"; + sha256 = "sha256-kE99FyilwwFv3zTCkufGwD3s1WwoJ2krg10l3Xy5PRE="; + }; - src = fetchTarball { + src = fetchurl { inherit (sysAttrs) url sha256; }; + in + (pkgs.vscode.override { isInsiders = true; }).overrideAttrs (oldAttrs: { pname = "vscode-insiders"; version = "1.122.0-insider"; - isInsiders = true; + inherit src; - buildInputs = (oldAttrs.buildInputs or []) - ++ stdenv.lib.optionals stdenv.hostPlatform.isLinux [ pkgs.krb5 pkgs.libsoup_3 pkgs.webkitgtk_4_1 ]; + buildInputs = + (oldAttrs.buildInputs or []) + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkgs.krb5 + pkgs.libsoup_3 + pkgs.webkitgtk_4_1 + ]; - prePatch = stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' + prePatch = lib.optionalString stdenv.hostPlatform.isLinux '' ${oldAttrs.prePatch or ""} + mkdir -p resources/app/node_modules/@vscode/ripgrep/bin touch resources/app/node_modules/@vscode/ripgrep/bin/rg ''; - preFixup = if stdenv.hostPlatform.isDarwin then '' - ${oldAttrs.preFixup or ""} - '' else '' - ${oldAttrs.preFixup or ""} - rm -rf resources/app/node_modules/@github/copilot-linuxmusl-x64 - ''; + preFixup = + if stdenv.hostPlatform.isDarwin then '' + ${oldAttrs.preFixup or ""} + '' else '' + ${oldAttrs.preFixup or ""} + + rm -rf resources/app/node_modules/@github/copilot-linuxmusl-x64 + ''; meta = (oldAttrs.meta or {}) // { - mainProgram = if stdenv.hostPlatform.isDarwin then "code-insiders" else "code-insiders"; + mainProgram = "code-insiders"; }; }) \ No newline at end of file