fix: vscode - password-store (#235)

* feat: vscode + code-cursor, fix password-store, update

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
This commit is contained in:
Ryan Yin
2025-11-16 21:47:47 +08:00
committed by GitHub
parent 62bac83db4
commit def33a486b
4 changed files with 69 additions and 84 deletions

View File

@@ -0,0 +1,15 @@
{
pkgs,
...
}:
{
home.packages = with pkgs; [
nixpaks.firefox
];
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
programs.google-chrome = {
enable = true;
package = if pkgs.stdenv.isAarch64 then pkgs.chromium else pkgs.google-chrome;
};
}

View File

@@ -0,0 +1,54 @@
{ lib, pkgs-master, ... }:
let
vscodeCliArgs = [
# https://code.visualstudio.com/docs/configure/settings-sync#_recommended-configure-the-keyring-to-use-with-vs-code
# For use with any package that implements the Secret Service API
# (for example gnome-keyring, kwallet5, KeepassXC)
"--password-store=gnome-libsecret"
];
code-cursor =
(pkgs-master.code-cursor.override {
commandLineArgs = lib.concatStringsSep " " vscodeCliArgs;
}).overrideAttrs
(oldAttrs: rec {
pname = "cursor";
version = "2.0.77";
src =
with pkgs-master;
appimageTools.extract {
inherit pname version;
src =
let
sources = {
x86_64-linux = fetchurl {
# curl -s https://api2.cursor.sh/updates/api/download/stable/linux-x64/cursor | jq
url = "https://downloads.cursor.com/production/ba90f2f88e4911312761abab9492c42442117cfe/linux/x64/Cursor-2.0.77-x86_64.AppImage";
hash = "sha256-/r7cmjgFhec7fEKUfFKw3vUoB9LJB2P/646cMeRKp/0=";
};
aarch64-linux = fetchurl {
# curl -s https://api2.cursor.sh/updates/api/download/stable/linux-arm64/cursor | jq
url = "https://downloads.cursor.com/production/ba90f2f88e4911312761abab9492c42442117cfe/linux/arm64/Cursor-2.0.77-aarch64.AppImage";
hash = "sha256-VKN9FAHjFTcdkUeBO2cLs92w6qzAbPl2kypTluRxbBA=";
};
};
in
sources.${stdenv.hostPlatform.system};
};
sourceRoot = "${pname}-${version}-extracted/usr/share/cursor";
});
in
{
home.packages = with pkgs-master; [
zed-editor
code-cursor
];
programs.vscode = {
enable = true;
package = pkgs-master.vscode.override {
commandLineArgs = vscodeCliArgs;
};
};
}

View File

@@ -1,52 +0,0 @@
{
pkgs,
...
}:
{
home.packages = with pkgs; [
nixpaks.firefox
];
programs = {
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
google-chrome = {
enable = true;
package = if pkgs.stdenv.isAarch64 then pkgs.chromium else pkgs.google-chrome;
# https://wiki.archlinux.org/title/Chromium#Native_Wayland_support
commandLineArgs = [
"--ozone-platform-hint=auto"
"--ozone-platform=wayland"
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
# (only supported by chromium/chrome at this time, not electron)
"--gtk-version=4"
# make it use text-input-v1, which works for kwin 5.27 and weston
"--enable-wayland-ime"
# enable hardware acceleration - vulkan api
# "--enable-features=Vulkan"
];
};
vscode = {
enable = true;
package = pkgs.vscode.override {
isInsiders = false;
# https://wiki.archlinux.org/title/Wayland#Electron
commandLineArgs = [
"--ozone-platform-hint=auto"
"--ozone-platform=wayland"
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
# (only supported by chromium/chrome at this time, not electron)
"--gtk-version=4"
# make it use text-input-v1, which works for kwin 5.27 and weston
"--enable-wayland-ime"
# TODO: fix https://github.com/microsoft/vscode/issues/187436
# still not works...
"--password-store=gnome" # use gnome-keyring as password store
];
};
};
};
}

View File

@@ -1,32 +0,0 @@
{ pkgs-master, ... }:
{
home.packages = with pkgs-master; [
zed-editor
(code-cursor.overrideAttrs (oldAttrs: rec {
pname = "cursor";
version = "2.0.43";
src = appimageTools.extract {
inherit pname version;
src =
let
sources = {
x86_64-linux = fetchurl {
# 2.0.43
# curl -s https://api2.cursor.sh/updates/api/download/stable/linux-x64/cursor | jq
url = "https://downloads.cursor.com/production/8e4da76ad196925accaa169efcae28c45454cce3/linux/x64/Cursor-2.0.43-x86_64.AppImage";
hash = "sha256-ok+7uBlI9d3a5R5FvMaWlbPM6tX2eCse7jZ7bmlPExY=";
};
aarch64-linux = fetchurl {
# 1.7.52
# curl -s https://api2.cursor.sh/updates/api/download/stable/linux-arm64/cursor | jq
url = "https://downloads.cursor.com/production/9675251a06b1314d50ff34b0cbe5109b78f848cd/linux/arm64/Cursor-1.7.52-aarch64.AppImage";
hash = "sha256-96zL0pmcrEyDEy8oW2qWk6RM8XGE4Gd2Aa3Hhq0qvk0=";
};
};
in
sources.${pkgs.system};
};
sourceRoot = "${pname}-${version}-extracted/usr/share/cursor";
}))
];
}