diff --git a/home/vscode/home.nix b/home/vscode/home.nix new file mode 100644 index 00000000..6662884b --- /dev/null +++ b/home/vscode/home.nix @@ -0,0 +1,23 @@ +{ pkgs +, lib +, config +, ... }: with lib; let + cfg = config.passthrough.vscode; +in mkIf cfg.enable { + programs.vscode = { + enable = true; + mutableExtensionsDir = false; + enableUpdateCheck = false; + enableExtensionUpdateCheck = false; + package = pkgs.vscodium; + extensions = with pkgs.vscode-extensions; [ + catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons + bbenoist.nix golang.go rust-lang.rust-analyzer + ]; + userSettings = { + "workbench.colorTheme" = "Catppuccin Frappé"; + "workbench.iconTheme" = "catppuccin-frappe"; + "[nix]"."editor.tabSize" = 2; + }; + }; +} diff --git a/home/vscode/nixos.nix b/home/vscode/nixos.nix new file mode 100644 index 00000000..7ecffe47 --- /dev/null +++ b/home/vscode/nixos.nix @@ -0,0 +1,19 @@ +{ pkgs +, lib +, config +, ... }: with lib; let + cfg = config.home.vscode; +in { + options.home.vscode = { + enable = mkEnableOption "vscode text editor"; + }; + + config = { + users.homeModules = [ + # this module passes vscode configuration to home-manager + { passthrough.vscode = cfg; } + ]; + + users.home.persist.directories = mkIf cfg.enable [ ".config/VSCodium" ]; + }; +}