vscodium on wayland

This commit is contained in:
Alexander Bantyev 2022-05-30 19:03:53 +04:00
parent 4d7ccb552a
commit 8962c13c03
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5

View File

@ -1,10 +1,38 @@
{ config, pkgs, inputs, ... }: { { config, pkgs, inputs, ... }:
let
codium-wayland = pkgs.buildEnv {
name = "codium-wayland";
paths = [
(pkgs.writeShellScriptBin "codium-wayland" ''
NIX_OZONE_WL=1 \
${config.home-manager.users.balsoft.programs.vscode.package}/bin/codium \
--enable-features=UseOzonePlatform \
--ozone-platform=wayland \
"$@"
'')
(pkgs.makeDesktopItem {
name = "codium-wayland";
desktopName = "VSCodium (Wayland)";
exec = "codium-wayland";
icon = "code";
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
mimeTypes = [ "text/plain" "inode/directory" ];
extraConfig = {
StartupNotify = "true";
StartupWMClass = "vscodium";
};
})
];
};
in {
environment.systemPackages = [ codium-wayland ];
defaultApplications.editor = { defaultApplications.editor = {
cmd = cmd = "${codium-wayland}/bin/codium-wayland";
"${config.home-manager.users.balsoft.programs.vscode.package}/bin/codium"; desktop = "codium-wayland";
desktop = "codium";
}; };
home-manager.users.balsoft = { home-manager.users.balsoft = {
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgs.vscodium;
@ -15,17 +43,17 @@
kahole.magit kahole.magit
(inputs.direnv-vscode.packages.${pkgs.system}.vsix.overrideAttrs (_: { (inputs.direnv-vscode.packages.${pkgs.system}.vsix.overrideAttrs (_: {
buildPhase = "yarn run build"; buildPhase = "yarn run build";
installPhase = installPhase = ''
"mkdir -p $out/share/vscode/extensions/direnv.direnv-vscode; cp -R * $out/share/vscode/extensions/direnv.direnv-vscode"; mkdir -p $out/share/vscode/extensions/direnv.direnv-vscode
cp -R * $out/share/vscode/extensions/direnv.direnv-vscode
'';
})) }))
(pkgs.callPackage ./theme.nix { } config.themes.colors) (pkgs.callPackage ./theme.nix { } config.themes.colors)
matklad.rust-analyzer matklad.rust-analyzer
ocamllabs.ocaml-platform
redhat.vscode-yaml redhat.vscode-yaml
bbenoist.nix jnoortheen.nix-ide
brettm12345.nixfmt-vscode
dhall.dhall-lang dhall.dhall-lang
hashicorp.terraform hashicorp.terraform
timonwong.shellcheck timonwong.shellcheck
@ -40,6 +68,7 @@
"/run/current-system/sw/bin/bash"; "/run/current-system/sw/bin/bash";
"terminal.integrated.defaultProfile.linux" = "bash"; "terminal.integrated.defaultProfile.linux" = "bash";
"editor.fontFamily" = "IBM Plex Mono"; "editor.fontFamily" = "IBM Plex Mono";
"nix.formatterPath" = "nixfmt";
}; };
keybindings = [{ keybindings = [{
key = "ctrl+shift+r"; key = "ctrl+shift+r";