From e5a8a5000121ae292c0c2bb8b7762349d866adc2 Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Thu, 1 May 2025 15:11:44 +0700 Subject: [PATCH] fix(nix/vesktop): NodeJS pain on macOS --- .config/nvim/lazy-lock.json | 18 +++++++++--------- nix/lib/mkSystem.nix | 3 ++- nix/overlays/vesktop.nix | 31 +++++++++++++++++++++---------- nix/systems/darwin/default.nix | 2 ++ 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 81a8290..45de9ce 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -6,17 +6,17 @@ "git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lualine.nvim": { "branch": "master", "commit": "86fe39534b7da729a1ac56c0466e76f2c663dc42" }, + "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" }, - "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "1ef260eb4f54515fe121a2267b477efb054d108a" }, + "nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lint": { "branch": "master", "commit": "d698d3b6fd7b1b85657d05a2a31d843ddb682c63" }, - "nvim-lspconfig": { "branch": "master", "commit": "32b6a6449aaba11461fffbb596dd6310af79eea4" }, - "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, - "nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" }, - "oil.nvim": { "branch": "master", "commit": "302bbaceeafc690e6419e0c8296e804d60cb9446" }, + "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" }, + "nvim-lspconfig": { "branch": "master", "commit": "94d0fec9135719e046903bbbbf8f39e3d3436d4e" }, + "nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" }, + "nvim-web-devicons": { "branch": "master", "commit": "50b5b06bff13a9b4eab946de7c7033649a6618a1" }, + "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, @@ -25,4 +25,4 @@ "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }, "vim-startuptime": { "branch": "master", "commit": "b6f0d93f6b8cf6eee0b4c94450198ba2d6a05ff6" }, "vim-wakatime": { "branch": "master", "commit": "e46d7c4f98ee0f40782008dd60cb2a79c377fb1d" } -} +} \ No newline at end of file diff --git a/nix/lib/mkSystem.nix b/nix/lib/mkSystem.nix index b5dea3b..ab7ef7d 100644 --- a/nix/lib/mkSystem.nix +++ b/nix/lib/mkSystem.nix @@ -3,7 +3,8 @@ let overlays = [ (import ../overlays/python.nix) - (import ../overlays/vesktop.nix) + # FIXME: Can't enable this here since brew-nix is not yet "initialized" at this point + #(import ../overlays/vesktop.nix) ] ++ extraOverlays; # Placed here so that we don't need to specify hash for fetchTarball diff --git a/nix/overlays/vesktop.nix b/nix/overlays/vesktop.nix index 0b3c729..3fd1213 100644 --- a/nix/overlays/vesktop.nix +++ b/nix/overlays/vesktop.nix @@ -1,13 +1,24 @@ final: prev: -{ - # Replace the icon with a much more low profile icon - # REF: https://github.com/Vencord/Vesktop/pull/865 - vesktop = prev.vesktop.overrideAttrs (old: { - preBuild = - old.preBuild - + '' - cp -f ${../../include/vesktop/icon.icns} build/icon.icns - ''; - }); +# Replace the icon with a much more low profile icon +# REF: https://github.com/Vencord/Vesktop/pull/865 +let + vesktop = if prev.stdenv.isDarwin then + # Use casks version because nodejs is pain + prev.casks.vesktop.overrideAttrs (old: { + configurePhase = + '' + cp -f ${../../include/vesktop/icon.icns} Contents/Resources/icon.icns + ''; + }) + else + prev.vesktop.overrideAttrs (old: { + preBuild = + old.preBuild + + '' + cp -f ${../../include/vesktop/icon.icns} build/icon.icns + ''; + }); +in { + inherit vesktop; } diff --git a/nix/systems/darwin/default.nix b/nix/systems/darwin/default.nix index 35a31e0..622fef7 100644 --- a/nix/systems/darwin/default.nix +++ b/nix/systems/darwin/default.nix @@ -29,6 +29,7 @@ in (mkBrew { inherit system brew-api; nixpkgs = nixpkgs-stable; }) (import ../../overlays/darwin/heliport.nix) (import ../../overlays/darwin/kanata.nix) + (import ../../overlays/vesktop.nix) ]; nur = nur; } @@ -58,6 +59,7 @@ in inputs.firefox-darwin.overlay (mkBrew { inherit system brew-api; nixpkgs = nixpkgs-stable; }) (import ../../overlays/darwin/kanata.nix) + (import ../../overlays/vesktop.nix) ]; nur = nur; }