diff --git a/Brewfile.work b/Brewfile.work index ad8b11e6..6114a04f 100644 --- a/Brewfile.work +++ b/Brewfile.work @@ -67,8 +67,6 @@ brew "pkgconf" brew "czkawka" # Secure runtime for JavaScript and TypeScript brew "deno" -# Load/unload environment variables based on $PWD -brew "direnv" # Tool for exploring each layer in a docker image brew "dive" # Measure DNS performance by simulating network conditions @@ -107,8 +105,6 @@ brew "fish" brew "fisher" # Command-line tools for fly.io services brew "flyctl" -# Fast and simple Node.js version manager -brew "fnm" # Command-line fuzzy finder written in Go brew "fzf" # GNU compiler collection @@ -343,8 +339,6 @@ cask "1password" cask "1password-cli" # AeroSpace is an i3-like tiling window manager for macOS cask "nikitabobko/tap/aerospace" -# Enable Windows-like alt-tab -cask "alt-tab" # Android SDK component cask "android-platform-tools" # AI Coding Agent IDE diff --git a/dot_config/mise/config.production.toml b/dot_config/mise/config.production.toml new file mode 100644 index 00000000..237048e3 --- /dev/null +++ b/dot_config/mise/config.production.toml @@ -0,0 +1,2 @@ +[env] +_.file = [".env", ".env.production"] diff --git a/dot_config/mise/config.staging.toml b/dot_config/mise/config.staging.toml new file mode 100644 index 00000000..c65023ce --- /dev/null +++ b/dot_config/mise/config.staging.toml @@ -0,0 +1,2 @@ +[env] +_.file = [".env", ".env.staging"] diff --git a/dot_config/mise/config.toml b/dot_config/mise/config.toml index f525e289..75515b7a 100644 --- a/dot_config/mise/config.toml +++ b/dot_config/mise/config.toml @@ -1,2 +1,6 @@ +[env] +_.file = [".env"] + [settings] -idiomatic_version_file_enable_tools = [] +idiomatic_version_file_enable_tools = ["node"] +auto_install = true diff --git a/dot_config/private_fish/completions/mise-env.fish b/dot_config/private_fish/completions/mise-env.fish new file mode 100644 index 00000000..668e9025 --- /dev/null +++ b/dot_config/private_fish/completions/mise-env.fish @@ -0,0 +1,4 @@ +complete -c mise-env -f +complete -c mise-env -a production -d 'Set MISE_ENV to production' +complete -c mise-env -a staging -d 'Set MISE_ENV to staging' +complete -c mise-env -a off -d 'Unset MISE_ENV' diff --git a/dot_config/private_fish/conf.d/fnm.fish b/dot_config/private_fish/conf.d/fnm.fish deleted file mode 100644 index 0986949d..00000000 --- a/dot_config/private_fish/conf.d/fnm.fish +++ /dev/null @@ -1 +0,0 @@ -fnm env --log-level quiet --use-on-cd | source diff --git a/dot_config/private_fish/config.fish b/dot_config/private_fish/config.fish index 07521824..ea406dbb 100644 --- a/dot_config/private_fish/config.fish +++ b/dot_config/private_fish/config.fish @@ -135,8 +135,7 @@ alias urlencode='python3 -c "import sys, urllib.parse as ul; \ starship init fish | source zoxide init fish | source -direnv hook fish | source -fnm env --use-on-cd | source +mise activate fish | source atuin init fish --disable-up-arrow | source source $HOME/.config/television/shell/integration.fish diff --git a/dot_config/private_fish/functions/mise-env.fish b/dot_config/private_fish/functions/mise-env.fish new file mode 100644 index 00000000..54ff80c4 --- /dev/null +++ b/dot_config/private_fish/functions/mise-env.fish @@ -0,0 +1,29 @@ +function mise-env --description 'Switch MISE_ENV between production, staging, or unset' + switch (count $argv) + case 0 + if set -q MISE_ENV + echo "MISE_ENV=$MISE_ENV" + else + echo "MISE_ENV is not set" + end + return + end + + switch $argv[1] + case prod production + set -gx MISE_ENV production + set -gx MISE_ENV_DISPLAY "๐Ÿšจ production" + echo "MISE_ENV=production" + case staging + set -gx MISE_ENV staging + set -gx MISE_ENV_DISPLAY "๐Ÿงช staging" + echo "MISE_ENV=staging" + case off none unset + set -e MISE_ENV + set -e MISE_ENV_DISPLAY + echo "MISE_ENV unset" + case '*' + echo "Usage: mise-env [production|staging|off]" + return 1 + end +end diff --git a/dot_config/starship.toml b/dot_config/starship.toml index e7b84ab9..f0613cfb 100644 --- a/dot_config/starship.toml +++ b/dot_config/starship.toml @@ -10,12 +10,10 @@ disabled = true variable = "YAZI_LEVEL" format = "[๐Ÿฆ†](yellow) " -[direnv] -disabled = false -format = '[$symbol$loaded]($style) ' -detect_files = [".envrc", ".env"] -loaded_msg = "๐Ÿ‘" -unloaded_msg = "๐Ÿšซ" +[env_var.MISE_ENV] +variable = "MISE_ENV_DISPLAY" +format = '[$env_value]($style) ' +style = "bold yellow" [git_metrics] disabled = false @@ -44,5 +42,3 @@ disabled = false [directory] truncate_to_repo = false truncation_length = 0 - - diff --git a/dot_config/zed/tasks.json b/dot_config/zed/tasks.json index 099dd1e8..a145fbdf 100644 --- a/dot_config/zed/tasks.json +++ b/dot_config/zed/tasks.json @@ -1,11 +1,4 @@ [ - { - "label": "python: run current file in venv", - "command": "source .venv/bin/activate.fish && direnv export fish | source && python $ZED_RELATIVE_FILE", - "use_new_terminal": false, - "allow_concurrent_runs": false, - "reveal": "always", - }, { "label": "lazygit", "command": "lazygit", @@ -17,9 +10,9 @@ "shell": { "with_arguments": { "program": "sh", - "args": ["--noediting", "--norc", "--noprofile"], - }, - }, + "args": ["--noediting", "--norc", "--noprofile"] + } + } }, { "label": "yazi", @@ -29,7 +22,7 @@ "hide": "always", "reveal": "always", "cwd": "$ZED_DIRNAME", - "env": { "EDITOR": "zed" }, + "env": { "EDITOR": "zed" } }, { "label": "file finder", @@ -42,9 +35,9 @@ "shell": { "with_arguments": { "program": "sh", - "args": ["--noediting", "--norc", "--noprofile"], - }, - }, + "args": ["--noediting", "--norc", "--noprofile"] + } + } }, { "label": "find in files", @@ -57,9 +50,9 @@ "shell": { "with_arguments": { "program": "sh", - "args": ["--noediting", "--norc", "--noprofile"], - }, - }, + "args": ["--noediting", "--norc", "--noprofile"] + } + } }, { "label": "find in files - selected text", @@ -72,9 +65,9 @@ "shell": { "with_arguments": { "program": "sh", - "args": ["--noediting", "--norc", "--noprofile"], - }, - }, + "args": ["--noediting", "--norc", "--noprofile"] + } + } }, { "label": "github browse", @@ -85,7 +78,7 @@ "reveal": "never", "reveal_target": "dock", "hide": "always", - "shell": "system", + "shell": "system" }, { "label": "go: add struct tags", @@ -101,15 +94,15 @@ "camelcase", "-skip-unexported", "-quiet", - "-w", + "-w" ], "reveal": "never", "hide": "always", "shell": { "with_arguments": { "program": "sh", - "args": ["--noediting", "--norc", "--noprofile"], - }, - }, - }, + "args": ["--noediting", "--norc", "--noprofile"] + } + } + } ]