diff --git a/nvim/dot-config/nvim/lua/tools.lua b/nvim/dot-config/nvim/lua/tools.lua index 5ccb3d7..e9446ab 100644 --- a/nvim/dot-config/nvim/lua/tools.lua +++ b/nvim/dot-config/nvim/lua/tools.lua @@ -43,6 +43,7 @@ tools.servers = { }, taplo = {}, neocmake = {}, + nil_ls = {}, } -- https://github.com/stevearc/conform.nvim @@ -58,6 +59,7 @@ tools.formatters = require("util.conform").assign_formatters({ lua = { "stylua" }, json = { "jq" }, toml = { "taplo" }, + nix = { "nixfmt" }, -- ["*"] = { "codespell" }, ["_"] = { "trim_whitespace", "trim_newlines" }, }) diff --git a/zsh/custom/themes/agnoster_dx.zsh-theme b/zsh/custom/themes/agnoster_dx.zsh-theme index 4a53eab..cb6956a 100644 --- a/zsh/custom/themes/agnoster_dx.zsh-theme +++ b/zsh/custom/themes/agnoster_dx.zsh-theme @@ -232,6 +232,27 @@ prompt_virtualenv() { fi } +# nix-shell: currently running nix-shell +prompt_nix_shell() { + if [[ -n "$IN_NIX_SHELL" ]]; then + if [[ -n $NIX_SHELL_PACKAGES ]]; then + local package_names="" + local packages=($NIX_SHELL_PACKAGES) + for package in $packages; do + package_names+=" ${package##*.}" + done + prompt_segment magenta black "$package_names" + elif [[ -n $name ]]; then + local cleanName=${name#interactive-} + cleanName=${cleanName#lorri-keep-env-hack-} + cleanName=${cleanName%-environment} + prompt_segment magenta black "$cleanName" + else # This case is only reached if the nix-shell plugin isn't installed or failed in some way + prompt_segment magenta black "nix-shell" + fi + fi +} + # Status: # - was there an error # - am I root @@ -262,6 +283,7 @@ build_prompt() { prompt_status prompt_context prompt_virtualenv + prompt_nix_shell prompt_aws prompt_dir prompt_git