From 614f8d5a9f70e9f397e900d57972c1d34d3ddb3e Mon Sep 17 00:00:00 2001 From: cspark Date: Thu, 18 Jul 2024 05:58:27 +0100 Subject: [PATCH] Add some command line utilities, LSP servers, switch to neovim as default editor --- global-home.nix | 30 +++++++++++++++++++++++++++++- global.nix | 31 ++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/global-home.nix b/global-home.nix index 73258e22..8520bfb7 100644 --- a/global-home.nix +++ b/global-home.nix @@ -94,7 +94,9 @@ in pass-wayland thunderbird + ripgrep yazi + ncdu # Just for utils pulseaudio @@ -181,6 +183,7 @@ in script = pkgs.writeShellScript "emacs-config-initialiser-script" '' if [[ ! -d $HOME/.emacs.d ]]; then + mkdir -p $HOME/.emacs.d git clone https://git.cspark.dev/cspark/Emacs-Configuration $HOME/.emacs.d else exit 0 @@ -199,6 +202,30 @@ in }; }; + # Neovim Config Init Service + systemd.user.services.neovim-config-initialiser = let + script = pkgs.writeShellScript "neovim-config-initialiser-script" + '' + if [[ ! -d $HOME/.config/neovim ]]; then + mkdir -p $HOME/.config/neovim + git clone https://git.cspark.dev/cspark/Neovim-Configuration $HOME/.config/neovim + else + exit 0 + fi + ''; + in + { + Unit = { + Description = "Initialises default neovim configuration if not available"; + }; + Service = { + ExecStart = "${script}"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + # Emacs install and enable daemon/server mode. Set to use unstable pure gtk branch (From emacs-overlay) services.emacs = { enable = true; @@ -247,7 +274,8 @@ in ]; home.sessionVariables = { - EDITOR = "emacsclient -nw"; + # EDITOR = "emacsclient -nw"; + EDITOR = "nvim"; # Dotnet path not found fix DOTNET_ROOT = "${pkgs.dotnet-sdk}"; diff --git a/global.nix b/global.nix index f12d5913..06c2e4e5 100644 --- a/global.nix +++ b/global.nix @@ -15,10 +15,8 @@ git gcc - # Web Stuff + # Programming Stuff, language servers etc nodejs - nodePackages.prettier - nodePackages.typescript-language-server typescript deno # Purely for the tooling @@ -29,6 +27,12 @@ lldb_18 # For lldb-dap clang-tools # clangd gnumake + cargo + lua-language-server + nodePackages.prettier + nodePackages.typescript-language-server + nodePackages.bash-language-server + python312Packages.jedi-language-server neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. fastfetch @@ -173,6 +177,7 @@ }; script = " if [[ ! -d $HOME/.emacs.d ]]; then + mkdir -p $HOME/.emacs.d git clone https://git.cspark.dev/cspark/Emacs-Configuration $HOME/.emacs.d else exit 0 @@ -180,6 +185,26 @@ "; }; + # Neovim Config Init Service - For root user also + systemd.services.neovim-config-initialiser = { + description = "Initialises default neovim configuration if not available"; + wantedBy = [ "multi-user.target" ]; + path = with pkgs; [ coreutils git ]; + enable = true; + serviceConfig = { + User = "root"; + Group = "root"; + }; + script = " + if [[ ! -d $HOME/.config/neovim ]]; then + mkdir -p $HOME/.config/neovim + git clone https://git.cspark.dev/cspark/Neovim-Configuration $HOME/.neovim.d + else + exit 0 + fi + "; + }; + # Emacs install and enable daemon/server mode. services.emacs = { enable = true;