From 1a0c925449cce67b8eaecca252f4b4552f6e2421 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sun, 15 Sep 2024 13:54:43 +0200 Subject: [PATCH] modules: Revert vscode from flatpak to modules If needed to be installed with flatpak, it can be installed from Discover --- modules/home/apps/flatpak/default.nix | 1 - modules/home/default.nix | 1 + modules/home/editors/default.nix | 7 ++++ modules/home/editors/vscode/default.nix | 47 +++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 modules/home/editors/default.nix create mode 100644 modules/home/editors/vscode/default.nix diff --git a/modules/home/apps/flatpak/default.nix b/modules/home/apps/flatpak/default.nix index 2e66e1a..7d2aa01 100644 --- a/modules/home/apps/flatpak/default.nix +++ b/modules/home/apps/flatpak/default.nix @@ -29,7 +29,6 @@ in { appId = "org.mozilla.Thunderbird"; origin = "flathub"; } { appId = "ch.protonmail.protonmail-bridge"; origin = "flathub"; } { appId = "org.kde.neochat"; origin = "flathub"; } - { appId = "com.visualstudio.code"; origin = "flathub"; } # Loisir { appId = "com.spotify.Client"; origin = "flathub"; } diff --git a/modules/home/default.nix b/modules/home/default.nix index ee5f717..adfece8 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -4,6 +4,7 @@ imports = [ ../common.nix ./apps + ./editors ./desktop ./shell ]; diff --git a/modules/home/editors/default.nix b/modules/home/editors/default.nix new file mode 100644 index 0000000..40db812 --- /dev/null +++ b/modules/home/editors/default.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./vscode + ]; +} \ No newline at end of file diff --git a/modules/home/editors/vscode/default.nix b/modules/home/editors/vscode/default.nix new file mode 100644 index 0000000..13ed250 --- /dev/null +++ b/modules/home/editors/vscode/default.nix @@ -0,0 +1,47 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.modules.home.editors.vscode; +in +{ + options.modules.home.editors.vscode = { + enable = mkEnableOption '' + Enable vscode with my custom configurations + ''; + }; + config = mkIf cfg.enable { + programs.vscode = { + enable = true; + enableUpdateCheck = false; + enableExtensionUpdateCheck = false; + + userSettings = { + "files.autoSave" = "onFocusChange"; + "emmet.includeLanguages" = { + "phoenix-heex" = "html"; + }; + "git.autofetch" = true; + }; + + userTasks = {}; + + extensions = with pkgs; with vscode-extensions; [ + # Nix + bbenoist.nix + + # Rust + rust-lang.rust-analyzer + serayuzgur.crates + tamasfe.even-better-toml + + # Phoenix + phoenixframework.phoenix + elixir-lsp.vscode-elixir-ls + + # Ruby + shopify.ruby-lsp + ]; + }; + }; +} \ No newline at end of file