feat: update code-cursor, fix password-store

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
This commit is contained in:
Ryan Yin
2025-11-16 20:05:28 +08:00
parent 9ef40d5529
commit cf03318374
4 changed files with 69 additions and 82 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,30 +0,0 @@
{ pkgs-master, ... }:
{
home.packages = with pkgs-master; [
zed-editor
(code-cursor.overrideAttrs (oldAttrs: rec {
pname = "cursor";
version = "2.0.77";
src = 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 = "";
};
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 = "";
};
};
in
sources.${pkgs.system};
};
sourceRoot = "${pname}-${version}-extracted/usr/share/cursor";
}))
];
}