1
1
Fork 0

vscode: do not use fhs env

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-02-04 16:45:32 -06:00
parent 95603f4d35
commit 066e5d203a
Signed by: Myned
GPG key ID: C7224454F7881A34

View file

@ -10,132 +10,133 @@ with lib; let
in { in {
options.custom.programs.vscode.enable = mkOption {default = false;}; options.custom.programs.vscode.enable = mkOption {default = false;};
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config = {
# https://wiki.nixos.org/wiki/VSCodium # Extension dependencies
# https://github.com/VSCodium/vscodium environment.systemPackages = with pkgs; [
#!! Configuration is imperative alejandra # nix-ide
programs.vscode = { blueprint-compiler # blueprint-gtk
enable = true; nixd # nix-ide
mutableExtensionsDir = false; powershell # powershell
shfmt # shell-format
];
# Extension dependencies home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Visual_Studio_Code#Use_VS_Code_extensions_without_additional_configuration # https://wiki.nixos.org/wiki/VSCodium
package = pkgs.vscodium.fhsWithPackages (ps: # https://github.com/VSCodium/vscodium
with ps; [ #!! Configuration is imperative
alejandra # nix-ide programs.vscode = {
blueprint-compiler # blueprint-gtk enable = true;
nixd # nix-ide mutableExtensionsDir = false;
powershell # powershell package = pkgs.vscodium;
shfmt # shell-format
]);
# https://github.com/nix-community/nix-vscode-extensions # https://github.com/nix-community/nix-vscode-extensions
#?? nixos-rebuild repl > inputs.nix-vscode-extensions.extensions.${pkgs.system}.* #?? nixos-rebuild repl > inputs.nix-vscode-extensions.extensions.${pkgs.system}.*
extensions = let extensions = let
# Use configured version of vscode # Use configured version of vscode
# https://github.com/nix-community/nix-vscode-extensions?tab=readme-ov-file#extensions # https://github.com/nix-community/nix-vscode-extensions?tab=readme-ov-file#extensions
#?? extension = with (repo "REPOSITORY"); AUTHOR.EXTENSION #?? extension = with (repo "REPOSITORY"); AUTHOR.EXTENSION
repo = repo: repo = repo:
with inputs.nix-vscode-extensions.extensions.${pkgs.system}; with inputs.nix-vscode-extensions.extensions.${pkgs.system};
(forVSCodeVersion config.home-manager.users.${config.custom.username}.programs.vscode.package.version).${repo}; (forVSCodeVersion config.home-manager.users.${config.custom.username}.programs.vscode.package.version).${repo};
in in
with (repo "open-vsx"); with (repo "open-vsx");
[ [
aaron-bond.better-comments aaron-bond.better-comments
antfu.iconify antfu.iconify
antfu.unocss antfu.unocss
bedsteler20.gnome-magic bedsteler20.gnome-magic
bilelmoussaoui.flatpak-vscode bilelmoussaoui.flatpak-vscode
bmalehorn.vscode-fish bmalehorn.vscode-fish
bmewburn.vscode-intelephense-client bmewburn.vscode-intelephense-client
bradlc.vscode-tailwindcss bradlc.vscode-tailwindcss
csstools.postcss csstools.postcss
dbaeumer.vscode-eslint dbaeumer.vscode-eslint
detachhead.basedpyright detachhead.basedpyright
#// eamodio.gitlens #// eamodio.gitlens
esbenp.prettier-vscode esbenp.prettier-vscode
foxundermoon.shell-format foxundermoon.shell-format
#// ginfuru.ginfuru-better-solarized-dark-theme #// ginfuru.ginfuru-better-solarized-dark-theme
gruntfuggly.todo-tree gruntfuggly.todo-tree
jnoortheen.nix-ide jnoortheen.nix-ide
koihik.vscode-lua-format koihik.vscode-lua-format
mhutchie.git-graph mhutchie.git-graph
mkhl.direnv mkhl.direnv
ms-python.black-formatter ms-python.black-formatter
ms-python.debugpy ms-python.debugpy
ms-python.isort ms-python.isort
ms-vscode.powershell ms-vscode.powershell
natizyskunk.sftp natizyskunk.sftp
pkief.material-icon-theme pkief.material-icon-theme
pkief.material-product-icons pkief.material-product-icons
sketchbuch.vsc-workspace-sidebar sketchbuch.vsc-workspace-sidebar
svelte.svelte-vscode svelte.svelte-vscode
timonwong.shellcheck timonwong.shellcheck
vincaslt.highlight-matching-tag vincaslt.highlight-matching-tag
] ]
++ (with (repo "vscode-marketplace"); [ ++ (with (repo "vscode-marketplace"); [
#!! Some extensions go missing from open-vsx, so use official marketplace as fallback #!! Some extensions go missing from open-vsx, so use official marketplace as fallback
# https://github.com/nix-community/nix-vscode-extensions?tab=readme-ov-file#note # https://github.com/nix-community/nix-vscode-extensions?tab=readme-ov-file#note
bodil.blueprint-gtk bodil.blueprint-gtk
cormoran.disable-default-keybinding cormoran.disable-default-keybinding
ms-python.python ms-python.python
sirmspencer.vscode-autohide sirmspencer.vscode-autohide
]); ]);
};
xdg.configFile = with config.home-manager.users.${config.custom.username}.lib.file; {
# Imperative symlinks intended to be synced
"VSCodium/User/settings.json" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/settings.json";
}; };
"VSCodium/User/keybindings.json" = { xdg.configFile = with config.home-manager.users.${config.custom.username}.lib.file; {
force = true; # Imperative symlinks intended to be synced
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/keybindings.json"; "VSCodium/User/settings.json" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/settings.json";
};
"VSCodium/User/keybindings.json" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/keybindings.json";
};
"VSCodium/User/snippets/" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/snippets/";
};
"VSCodium/User/profiles/" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/profiles/";
};
}; };
"VSCodium/User/snippets/" = { home = {
force = true; # https://github.com/nix-community/nixd/blob/main/nixd/docs/features.md
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/snippets/"; sessionVariables.NIXD_FLAGS = "--inlay-hints=false"; # Disable package versions in the editor
# Work around wrong wmclass
# https://github.com/microsoft/vscode/issues/129953
# https://github.com/VSCodium/vscodium/issues/1414
#!! Keep updated with upstream desktop file
#?? cat /etc/profiles/per-user/USER/share/applications/codium.desktop
# file.".local/share/applications/codium.desktop".text = ''
# [Desktop Entry]
# Actions=new-empty-window
# Categories=Utility;TextEditor;Development;IDE
# Comment=Code Editing. Redefined.
# Exec=codium %F
# GenericName=Text Editor
# Icon=vscodium
# Keywords=vscode
# MimeType=text/plain;inode/directory
# Name=VSCodium
# StartupNotify=true
# StartupWMClass=codium-url-handler
# Type=Application
# Version=1.4
# [Desktop Action new-empty-window]
# Exec=codium --new-window %F
# Icon=vscodium
# Name=New Empty Window
# '';
}; };
"VSCodium/User/profiles/" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/profiles/";
};
};
home = {
# https://github.com/nix-community/nixd/blob/main/nixd/docs/features.md
sessionVariables.NIXD_FLAGS = "--inlay-hints=false"; # Disable package versions in the editor
# Work around wrong wmclass
# https://github.com/microsoft/vscode/issues/129953
# https://github.com/VSCodium/vscodium/issues/1414
#!! Keep updated with upstream desktop file
#?? cat /etc/profiles/per-user/USER/share/applications/codium.desktop
# file.".local/share/applications/codium.desktop".text = ''
# [Desktop Entry]
# Actions=new-empty-window
# Categories=Utility;TextEditor;Development;IDE
# Comment=Code Editing. Redefined.
# Exec=codium %F
# GenericName=Text Editor
# Icon=vscodium
# Keywords=vscode
# MimeType=text/plain;inode/directory
# Name=VSCodium
# StartupNotify=true
# StartupWMClass=codium-url-handler
# Type=Application
# Version=1.4
# [Desktop Action new-empty-window]
# Exec=codium --new-window %F
# Icon=vscodium
# Name=New Empty Window
# '';
}; };
}; };
} }