My system configuration via Nix flakes
use std/util "path add"

# PATH
path add "~/.cargo/bin"

# Environment variables
$env.CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense'
$env.DIFF = "difft"
$env.EDITOR = "hx"
$env.NU_EXPERIMENTAL_OPTIONS = "all"
$env.SSH_AUTH_SOCK = "/run/user/1000/gcr/ssh"

# Configuration
# TODO: add `$env.config.cp.progress_bar`
$env.config.buffer_editor = "hx"
$env.config.rm.always_trash = true
$env.config.show_banner = false
$env.config.use_kitty_protocol = true

# Aliases
alias c = cargo
alias p = pijul
alias rebuild = /home/finchie/config/src/rebuild.nu

# Direnv hook (from https://www.nushell.sh/cookbook/direnv.html#configuring-direnv)
$env.config = {
  hooks: {
    pre_prompt: [{ ||
      if (which direnv | is-empty) {
        return
      }

      direnv export json | from json | default {} | load-env
      if 'ENV_CONVERSIONS' in $env and 'PATH' in $env.ENV_CONVERSIONS {
        $env.PATH = do $env.ENV_CONVERSIONS.PATH.from_string $env.PATH
      }
    }]
  }
}

# Drop into the Projects directory
cd ~/Projects