mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-23 17:28:33 +02:00
feat: add vscode again, to get the best experience of copilot chat
This commit is contained in:
@@ -30,14 +30,17 @@
|
|||||||
# ls /etc/profiles/per-user/ryan/share/applications/
|
# ls /etc/profiles/per-user/ryan/share/applications/
|
||||||
mimeApps = {
|
mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
# let `xdg-open` to open the url with the correct application.
|
||||||
defaultApplications = let
|
defaultApplications = let
|
||||||
browser = ["firefox.desktop"];
|
browser = ["firefox.desktop"];
|
||||||
|
editor = ["nvim.desktop" "Helix.desktop" "code.desktop" "code-insiders.desktop"];
|
||||||
in {
|
in {
|
||||||
"application/json" = browser;
|
"application/json" = browser;
|
||||||
"application/pdf" = browser; # TODO: pdf viewer
|
"application/pdf" = browser; # TODO: pdf viewer
|
||||||
|
|
||||||
"text/html" = browser;
|
"text/html" = browser;
|
||||||
"text/xml" = browser;
|
"text/xml" = browser;
|
||||||
|
"text/plain" = editor;
|
||||||
"application/xml" = browser;
|
"application/xml" = browser;
|
||||||
"application/xhtml+xml" = browser;
|
"application/xhtml+xml" = browser;
|
||||||
"application/xhtml_xml" = browser;
|
"application/xhtml_xml" = browser;
|
||||||
@@ -48,12 +51,18 @@
|
|||||||
"application/x-extension-shtml" = browser;
|
"application/x-extension-shtml" = browser;
|
||||||
"application/x-extension-xht" = browser;
|
"application/x-extension-xht" = browser;
|
||||||
"application/x-extension-xhtml" = browser;
|
"application/x-extension-xhtml" = browser;
|
||||||
|
"application/x-wine-extension-ini" = editor;
|
||||||
|
|
||||||
"x-scheme-handler/about" = browser;
|
# define default applications for some url schemes.
|
||||||
"x-scheme-handler/ftp" = browser;
|
"x-scheme-handler/about" = browser; # open `about:` url with `browser`
|
||||||
|
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
|
||||||
"x-scheme-handler/http" = browser;
|
"x-scheme-handler/http" = browser;
|
||||||
"x-scheme-handler/https" = browser;
|
"x-scheme-handler/https" = browser;
|
||||||
"x-scheme-handler/unknown" = browser;
|
# https://github.com/microsoft/vscode/issues/146408
|
||||||
|
"x-scheme-handler/vscode" = ["code-url-handler.desktop"]; # open `vscode://` url with `code-url-handler.desktop`
|
||||||
|
"x-scheme-handler/vscode-insiders" = ["code-insiders-url-handler.desktop"]; # open `vscode-insiders://` url with `code-insiders-url-handler.desktop`
|
||||||
|
# all other unknown schemes will be opened by this default application.
|
||||||
|
# "x-scheme-handler/unknown" = editor;
|
||||||
|
|
||||||
"x-scheme-handler/discord" = ["discord.desktop"];
|
"x-scheme-handler/discord" = ["discord.desktop"];
|
||||||
"x-scheme-handler/tg" = ["org.telegram.desktop.desktop "];
|
"x-scheme-handler/tg" = ["org.telegram.desktop.desktop "];
|
||||||
|
|||||||
@@ -58,5 +58,34 @@
|
|||||||
enableGnomeExtensions = false;
|
enableGnomeExtensions = false;
|
||||||
package = pkgs.firefox-wayland; # firefox with wayland support
|
package = pkgs.firefox-wayland; # firefox with wayland support
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vscode = {
|
||||||
|
enable = true;
|
||||||
|
# let vscode sync and update its configuration & extensions across devices, using github account.
|
||||||
|
userSettings = {};
|
||||||
|
package =
|
||||||
|
(pkgs.vscode.override
|
||||||
|
{
|
||||||
|
isInsiders = true;
|
||||||
|
commandLineArgs = [
|
||||||
|
# "--disable-gpu"
|
||||||
|
# make it use text-input-v1, which works for kwin 5.27 and weston
|
||||||
|
"--enable-features=UseOzonePlatform"
|
||||||
|
"--ozone-platform=wayland"
|
||||||
|
"--enable-wayland-ime"
|
||||||
|
# TODO: fix https://github.com/microsoft/vscode/issues/187436
|
||||||
|
# still not works...
|
||||||
|
"--password-store=gnome" # use gnome-keyring as password store
|
||||||
|
];
|
||||||
|
})
|
||||||
|
.overrideAttrs (oldAttrs: rec {
|
||||||
|
# Use VSCode Insiders to fix crash: https://github.com/NixOS/nixpkgs/issues/246509
|
||||||
|
src = builtins.fetchTarball {
|
||||||
|
url = "https://update.code.visualstudio.com/latest/linux-x64/insider";
|
||||||
|
sha256 = "0k2sh7rb6mrx9d6bkk2744ry4g17d13xpnhcisk4akl4x7dn6a83";
|
||||||
|
};
|
||||||
|
version = "latest";
|
||||||
|
});
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
firefox
|
firefox
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
|
||||||
programs = {
|
programs = {
|
||||||
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
||||||
google-chrome = {
|
google-chrome = {
|
||||||
@@ -16,5 +19,11 @@
|
|||||||
# commandLineArgs = [
|
# commandLineArgs = [
|
||||||
# ];
|
# ];
|
||||||
};
|
};
|
||||||
|
vscode = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs-unstable.vscode;
|
||||||
|
# let vscode sync and update its configuration & extensions across devices, using github account.
|
||||||
|
# userSettings = {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user