fix: firefox desktop entry offload patch

This commit is contained in:
DACHXY 2025-01-08 14:23:03 +08:00
parent 5a0f9f2992
commit 6f4a849ddb
8 changed files with 66 additions and 2 deletions

View file

@ -36,6 +36,8 @@ require("lazy").setup({
{ import = "lazyvim.plugins.extras.lang.markdown" }, { import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.nushell" }, { import = "lazyvim.plugins.extras.lang.nushell" },
{ import = "lazyvim.plugins.extras.lang.omnisharp" }, { import = "lazyvim.plugins.extras.lang.omnisharp" },
-- { import = "lazyvim.plugins.extras.lang.vue" },
-- { import = "lazyvim.plugins.extras.lang.typescript" },
-- { import = "lazyvim.plugins.extras.lang.python" }, -- { import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.rust" }, { import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.tailwind" }, { import = "lazyvim.plugins.extras.lang.tailwind" },

View file

@ -82,6 +82,14 @@ return {
cmd = { "vscode-json-languageserver", "--stdio" }, cmd = { "vscode-json-languageserver", "--stdio" },
filetypes = { "json" }, filetypes = { "json" },
}, },
vuels = {
cmd = { "vue-language-server", "--stdio" },
filetypes = { "vue" },
},
ts_ls = {
cmd = { "typescript-language-server", "--stdio" },
filetypes = { "vue", "ts", "tsx" },
},
}, },
}, },
setup = {}, setup = {},

View file

@ -12,6 +12,7 @@
./hyprland.nix ./hyprland.nix
./swaync.nix ./swaync.nix
./neovim.nix ./neovim.nix
./desktop.nix
inputs.hyprland.homeManagerModules.default inputs.hyprland.homeManagerModules.default
]; ];

50
home/user/desktop.nix Normal file
View file

@ -0,0 +1,50 @@
{
nvidia-offload-enabled,
lib,
pkgs,
...
}:
let
offloadScript = import ../../system/modules/offload.nix { inherit pkgs; };
launcher = "${offloadScript}/bin/offload firefox";
in
with lib;
{
xdg.desktopEntries = lib.mkIf nvidia-offload-enabled {
firefox = {
actions = {
"new-private-window" = {
exec = "${launcher} --private-window %U";
name = "New Private Window";
};
"new-window" = {
exec = "${launcher} --new-window %U";
name = "New Window";
};
"profile-manager-window" = {
exec = "${launcher} --ProfileManager";
name = "Profile Manager";
};
};
exec = "${launcher} --name firefox %U";
categories = [
"Network"
"WebBrowser"
];
genericName = "Web Browser";
name = "Firefox";
startupNotify = true;
terminal = false;
type = "Application";
icon = "firefox";
mimeType = [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
};
}

View file

@ -53,6 +53,7 @@ in
pyright pyright
hadolint hadolint
yaml-language-server yaml-language-server
nodePackages_latest.typescript
]; ];
programs.neovim = { programs.neovim = {

View file

@ -55,5 +55,4 @@ in
}; };
}; };
}; };
} }

View file

@ -13,5 +13,6 @@
marksman marksman
nginx-language-server nginx-language-server
nodePackages_latest.vscode-json-languageserver nodePackages_latest.vscode-json-languageserver
bash-language-server
]; ];
} }

View file

@ -1,4 +1,6 @@
{ pkgs, ... }: {
pkgs,
}:
pkgs.writeShellScriptBin "offload" '' pkgs.writeShellScriptBin "offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1 export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0