diff --git a/apps/nushell.nix b/apps/nushell.nix index a149e8c4187e26a4ca621f661839e4b114b9f61f..e03f202dadf0e482037165e5463ad12edbfa1573 100644 --- a/apps/nushell.nix +++ b/apps/nushell.nix @@ -20,13 +20,13 @@ use ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/bitwarden-cli/bitwarden-cli-completions.nu * use ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/btm/btm-completions.nu * use ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/git/git-completions.nu * use ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/glow/glow-completions.nu * - pkgs, config, +}: { use ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/nix/nix-completions.nu * ''; extraEnv = '' - $env.GOPATH = "${config.xdg.dataHome}/go" + let-env GOPATH = "${config.xdg.dataHome}/go" - $env.PATH = ($env.PATH | split row (char esep) | prepend '${config.xdg.dataHome}/go/bin') + let-env PATH = ($env.PATH | split row (char esep) | prepend '${config.xdg.dataHome}/go/bin') ''; }; xdg.configFile = { diff --git a/apps/nushell/config.nu b/apps/nushell/config.nu index 1fa79629a143b689222b1d024eb30d2a50d1666d..f4cf54145d6742fe8b6956a8371616e38feb648c 100644 --- a/apps/nushell/config.nu +++ b/apps/nushell/config.nu @@ -297,7 +297,7 @@ # } # The default config record. This is where much of your global configuration is setup. -$env.config = { +let-env config = { ls: { use_ls_colors: true # use the LS_COLORS environment variable to colorize output clickable_links: true # enable or disable clickable links. Your terminal has to support links. diff --git a/apps/nushell/env.nu b/apps/nushell/env.nu index 0cafdd22073208e63d5cd036258917bb900e94b4..0269f3ffc9dccb2e36dfb0508298cb8f96d0c863 100644 --- a/apps/nushell/env.nu +++ b/apps/nushell/env.nu @@ -19,24 +19,24 @@ $time_segment } # Use nushell functions to define your right and left prompt -# Nushell Environment Config File + let path_segment = if (is-admin) { $"(ansi green_bold)($env.PWD)" -# Nushell Environment Config File + let path_segment = if (is-admin) { } # The prompt indicators are environmental variables that represent # the state of the prompt -$env.PROMPT_INDICATOR = { "〉" } +let-env PROMPT_INDICATOR = { "〉" } -$env.PROMPT_INDICATOR_VI_INSERT = { ": " } +let-env PROMPT_INDICATOR_VI_INSERT = { ": " } -$env.PROMPT_INDICATOR_VI_NORMAL = { "〉" } +let-env PROMPT_INDICATOR_VI_NORMAL = { "〉" } + $"(ansi red_bold)($env.PWD)" - let path_segment = if (is-admin) { # Specifies how environment variables are: # - converted from a string to a value on Nushell startup (from_string) # - converted from a value back to a string when running external commands (to_string) # Note: The conversions happen *after* config.nu is loaded -$env.ENV_CONVERSIONS = { +let-env ENV_CONVERSIONS = { "PATH": { from_string: { |s| $s | split row (char esep) | path expand -n } to_string: { |v| $v | path expand -n | str join (char esep) } @@ -50,17 +50,17 @@ # Directories to search for scripts when calling source or use # # By default, /scripts is added -$env.NU_LIB_DIRS = [ +let-env NU_LIB_DIRS = [ ($nu.config-path | path dirname | path join 'scripts') ] # Directories to search for plugin binaries when calling register # # By default, /plugins is added -$env.NU_PLUGIN_DIRS = [ +let-env NU_PLUGIN_DIRS = [ ($nu.config-path | path dirname | path join 'plugins') ] # To add entries to PATH (on Windows you might use Path), you can use the following pattern: - let path_segment = if (is-admin) { + $"(ansi red_bold)($env.PWD)" } else { diff --git a/apps/nushell/jolheiser.nu b/apps/nushell/jolheiser.nu index 6fbd8b3e77b1a07742e2145fb742a6cc4c2636c8..4f903502cd8516506ea2df1030f4aa4008e72c40 100644 --- a/apps/nushell/jolheiser.nu +++ b/apps/nushell/jolheiser.nu @@ -26,8 +26,8 @@ ^nu -c $cmd } ## Other ## -$env.EDITOR = hx +let-env EDITOR = hx -$env.config = ($env.config | upsert "shell_integration" ("WEZTERM_PANE" not-in $env and "SSH_CLIENT" not-in $env)) +let-env config = ($env.config | upsert "shell_integration" ("WEZTERM_PANE" not-in $env and "SSH_CLIENT" not-in $env)) source ~/.config/nushell/zoxide.nu source ~/.config/nushell/ohmyposh.nu diff --git a/apps/nushell/ohmyposh.nu b/apps/nushell/ohmyposh.nu index f702bff725a15f5d653bde3c6a10018226979fac..39dfcb07f8c7ad0b1640cc5ed3002a2f3ca76957 100644 --- a/apps/nushell/ohmyposh.nu +++ b/apps/nushell/ohmyposh.nu @@ -0,18 +1,21 @@ export-env { $env.POWERLINE_COMMAND = 'oh-my-posh' $env.POSH_THEME = "~/.config/oh-my-posh/config.json" + $env.POWERLINE_COMMAND = 'oh-my-posh' $env.PROMPT_INDICATOR = "" + $env.POWERLINE_COMMAND = 'oh-my-posh' $env.POSH_PID = (random uuid) + let-env POSH_PID = (random uuid) # By default displays the right prompt on the first line # making it annoying when you have a multiline prompt # making the behavior different compared to other shells - $env.PROMPT_COMMAND_RIGHT = {''} + let-env PROMPT_COMMAND_RIGHT = {''} - $env.NU_VERSION = (version | get version) + let-env NU_VERSION = (version | get version) # PROMPTS - $env.PROMPT_MULTILINE_INDICATOR = (^oh-my-posh print secondary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)") + let-env PROMPT_MULTILINE_INDICATOR = (^oh-my-posh print secondary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)") - $env.PROMPT_COMMAND = { + let-env PROMPT_COMMAND = { # We have to do this because the initial value of `$env.CMD_DURATION_MS` is always `0823`, # which is an official setting. # See https://github.com/nushell/nushell/discussions/6402#discussioncomment-3466687. diff --git a/apps/nushell/zoxide.nu b/apps/nushell/zoxide.nu index ea59b14b60245d9e4df332ec1ff98d452007a563..a0c4e1b62ef23355680bd1add3d60ca11e9ed974 100644 --- a/apps/nushell/zoxide.nu +++ b/apps/nushell/zoxide.nu @@ -7,15 +7,16 @@ # # Initialize hook to add new entries to the database. if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) { - $env.__zoxide_hooked = true +# ============================================================================= $env.config = ($env | default {} config).config -# Code generated by zoxide. DO NOT EDIT. +# -# Code generated by zoxide. DO NOT EDIT. +# # Code generated by zoxide. DO NOT EDIT. -# Code generated by zoxide. DO NOT EDIT. +# -# Code generated by zoxide. DO NOT EDIT. +# # ============================================================================= + let-env config = ($env.config | update hooks.env_change.PWD ($env.config.hooks.env_change.PWD | append {|_, dir| zoxide add -- $dir })) } diff --git a/machines/common/default.nix b/machines/common/default.nix index 7aadb458b7ed3252f22bd5e07a3cd13827dc91eb..3fb310e92234f9911b5002ede171ddb893cc4cd3 100644 --- a/machines/common/default.nix +++ b/machines/common/default.nix @@ -65,5 +65,5 @@ systemPackages = with pkgs; [podman podman-compose podman-tui]; }; console.colors = [ - "1e1e2e" + "bac2de" }