diff --git a/hosts/ti-clt-dsk01/home.nix b/hosts/ti-clt-dsk01/home.nix index f41fa7c..d92a98c 100644 --- a/hosts/ti-clt-dsk01/home.nix +++ b/hosts/ti-clt-dsk01/home.nix @@ -18,7 +18,15 @@ applications.devenv.enable = true; applications.firefox.enable = true; applications.git.enable = true; - applications.helix.enable = true; + applications.helix = { + enable = true; + markdown = true; + rust = true; + systemverilog = true; + nix = true; + latex = true; + vue = true; + }; applications.zsh.enable = true; applications.ssh.enable = true; applications.thunderbird.enable = true; @@ -51,6 +59,7 @@ unstable.prusa-slicer unstable.surfer # waveform viewer + pomodoro-gtk # Office libreoffice diff --git a/modules/home/applications/helix.nix b/modules/home/applications/helix.nix index 701551c..3b6662a 100644 --- a/modules/home/applications/helix.nix +++ b/modules/home/applications/helix.nix @@ -12,47 +12,79 @@ in { Enable helix text editor ''; }; + + settings.applications.helix.markdown = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enable markdown language support + ''; + }; + + settings.applications.helix.systemverilog = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enable systemverilog language support + ''; + }; + + settings.applications.helix.nix = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Enable nix language support + ''; + }; + + settings.applications.helix.latex = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Enable latex language support + ''; + }; + + settings.applications.helix.vue = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Enable vue/nuxt language support + ''; + }; + + settings.applications.helix.rust = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enable rust language support + ''; + }; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - # Markdown - unstable.marksman - unstable.markdown-oxide - dprint - - # Systemverilog - unstable.svls - - # Assembly - unstable.asm-lsp - - # Nixos - unstable.nil - unstable.nixpkgs-fmt - - # Latex - tectonic - unstable.texlab - - # Vue/Nuxt - unstable.vue-language-server - unstable.typescript - unstable.typescript-language-server + home.packages = with pkgs; lib.concatLists [ + (lib.optionals cfg.markdown [ unstable.marksman unstable.markdown-oxide dprint ]) + (lib.optionals cfg.systemverilog [ unstable.svls ]) + (lib.optionals cfg.nix [ unstable.nix unstable.nixpkgs-fmt ]) + (lib.optionals cfg.latex [ tectonic unstable.texlab ]) + (lib.optionals cfg.vue [ unstable.vue-language-server unstable.typescript unstable.typescript-language-server ]) ]; # Markdown - home.file.".config/.dprint.json".text ='' - { - "markdown": { - "lineWidth":120, - }, - "excludes": [], - "plugins": [ - "https://plugins.dprint.dev/markdown-0.16.1.wasm" - ] - } - ''; + home.file.".config/.dprint.json" = lib.mkIf cfg.markdown { + text = '' + { + "markdown": { + "lineWidth":120, + }, + "excludes": [], + "plugins": [ + "https://plugins.dprint.dev/markdown-0.16.1.wasm" + ] + } + ''; + }; programs.helix = { enable = true; @@ -65,24 +97,19 @@ in { }; languages = { # Rust - language-server.rust-analyzer.config = { + language-server.rust-analyzer.config = lib.mkIf cfg.rust { cargo = { features = "all"; }; }; # Systemverilog - language-server.svls = { + language-server.svls = lib.mkIf cfg.systemverilog { command = "svls"; }; - # Systemverilog - language-server.asm = { - command = "asm-lsp"; - }; - # Latex - language-server.texlab = { + language-server.texlab = lib.mkIf cfg.latex { config = { texlab.chktex = { onOpenAndSave = true; @@ -116,7 +143,7 @@ in { }; }; - language-server.typescript-language-server.config = { + language-server.typescript-language-server.config = lib.mkIf cfg.vue { # tsserver = { # path = "${pkgs.unstable.typescript}/bin/tsserver"; # }; @@ -148,18 +175,12 @@ in { # }; # }; - language = [ - { + language = lib.concatLists [ + (lib.optionals cfg.systemverilog [{ name = "verilog"; language-servers = [ "svls" ]; - } - { - name = "asm"; - scope = "source.s"; - language-servers = [ "asm" ]; - file-types = [ "s" "S" ]; - } - { + }]) + (lib.optionals cfg.markdown [{ name = "markdown"; auto-format = true; language-servers = [ "markdown-oxide" ]; @@ -170,11 +191,11 @@ in { name = "typst"; auto-format = false; formatter.command = "${pkgs.typstfmt}/bin/typstfmt"; - } - { + }]) + (lib.optionals cfg.vue [{ name = "vue"; language-servers = ["vuels" "typescript-language-server"]; - } + }]) ]; }; };