nixos-config/profiles/applications/vscodium/default.nix

106 lines
3.2 KiB
Nix
Raw Normal View History

2022-05-30 19:03:53 +04:00
{ config, pkgs, inputs, ... }:
let
2022-06-02 13:29:09 +04:00
EDITOR = pkgs.writeShellScript "codium-editor" ''
NIX_OZONE_WL=1 \
exec \
${config.home-manager.users.balsoft.programs.vscode.package}/bin/codium \
--enable-features=UseOzonePlatform \
--ozone-platform=wayland \
-w -n \
"$@"
'';
2022-05-30 19:03:53 +04:00
codium-wayland = pkgs.buildEnv {
name = "codium-wayland";
paths = [
(pkgs.writeShellScriptBin "codium-wayland" ''
NIX_OZONE_WL=1 \
2022-06-02 00:20:48 +04:00
exec \
2022-05-30 19:03:53 +04:00
${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";
};
})
];
};
2022-06-02 20:21:47 +04:00
custom-extensions = import ./extensions.nix {
inherit (pkgs.vscode-utils) buildVscodeMarketplaceExtension;
};
2022-05-30 19:03:53 +04:00
in {
environment.systemPackages = [ codium-wayland ];
2022-05-30 14:12:15 +04:00
defaultApplications.editor = {
2022-06-02 13:29:09 +04:00
cmd = "${EDITOR}";
2022-05-30 19:03:53 +04:00
desktop = "codium-wayland";
2022-05-30 14:12:15 +04:00
};
home-manager.users.balsoft = {
2022-05-30 19:03:53 +04:00
2022-05-30 14:12:15 +04:00
programs.vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
2022-06-02 20:21:47 +04:00
extensions = with pkgs.vscode-extensions;
[
kahole.magit
(inputs.direnv-vscode.packages.${pkgs.system}.vsix.overrideAttrs (_: {
buildPhase = "yarn run build";
installPhase = ''
mkdir -p $out/share/vscode/extensions/direnv.direnv-vscode
cp -R * $out/share/vscode/extensions/direnv.direnv-vscode
'';
}))
2022-05-30 14:12:15 +04:00
2022-06-02 20:21:47 +04:00
(pkgs.callPackage ./theme.nix { } config.themes.colors)
2022-05-30 14:12:15 +04:00
2022-06-02 20:21:47 +04:00
matklad.rust-analyzer
redhat.vscode-yaml
jnoortheen.nix-ide
dhall.dhall-lang
hashicorp.terraform
timonwong.shellcheck
bungcip.better-toml
haskell.haskell
justusadam.language-haskell
ms-python.python
github.vscode-pull-request-github
] ++ pkgs.lib.concatMap builtins.attrValues
(builtins.attrValues custom-extensions);
2022-05-30 14:12:15 +04:00
userSettings = {
2022-05-30 15:39:23 +04:00
"update.mode" = "none";
2022-05-30 14:12:15 +04:00
"[nix]"."editor.tabSize" = 2;
"workbench.colorTheme" = "Balsoft's generated theme";
2022-05-30 15:37:42 +04:00
"terminal.integrated.profiles.linux".bash.path =
"/run/current-system/sw/bin/bash";
"terminal.integrated.defaultProfile.linux" = "bash";
"editor.fontFamily" = "IBM Plex Mono";
2022-05-30 19:03:53 +04:00
"nix.formatterPath" = "nixfmt";
2022-06-01 21:19:11 +04:00
"git.autofetch" = true;
2022-06-02 13:29:09 +04:00
"redhat.telemetry.enabled" = false;
2022-06-01 21:19:11 +04:00
"vscode-neovim.neovimExecutablePaths.linux" = "${pkgs.neovim}/bin/nvim";
2022-06-02 00:07:19 +04:00
"vscode-neovim.useCtrlKeysForNormalMode" = false;
"vscode-neovim.mouseSelectionStartVisualMode" = true;
2022-06-02 20:21:47 +04:00
"security.workspace.trust.untrustedFiles" = "open";
2022-05-30 14:12:15 +04:00
};
2022-05-30 15:25:46 +04:00
keybindings = [{
key = "ctrl+shift+r";
command = "workbench.action.tasks.runTask";
when = "textInputFocus";
}];
2022-05-30 14:12:15 +04:00
};
};
}