mirror of
https://github.com/ryanccn/flake.git
synced 2025-12-06 08:10:43 +01:00
feat: adopt XDG base directories
This commit is contained in:
parent
b1984a512c
commit
c6c59dd552
7 changed files with 40 additions and 24 deletions
|
|
@ -14,17 +14,32 @@ fish_add_path -Pm /etc/profiles/per-user/$USER/bin /run/current-system/sw/bin
|
|||
fnm env --use-on-cd | source
|
||||
|
||||
# cargo
|
||||
fish_add_path -P "$HOME/.cargo/bin"
|
||||
fish_add_path -P "$CARGO_HOME/bin"
|
||||
# go
|
||||
fish_add_path -P "$GOPATH/bin"
|
||||
# deno
|
||||
fish_add_path -P "$HOME/.deno/bin"
|
||||
|
||||
# pnpm
|
||||
set -x PNPM_HOME "$HOME/Library/pnpm"
|
||||
fish_add_path -P "$PNPM_HOME"
|
||||
|
||||
# docker
|
||||
fish_add_path -P "$HOME/.docker/bin"
|
||||
# local bin
|
||||
fish_add_path -P "$HOME/.local/bin"
|
||||
|
||||
function expose_app_to_path
|
||||
set -f app $argv[1]
|
||||
|
||||
if test -d ~/"Applications/$app.app"
|
||||
fish_add_path -P ~/"Applications/$app.app/Contents/MacOS"
|
||||
end
|
||||
if test -d "/Applications/$app.app"
|
||||
fish_add_path -P "/Applications/$app.app/Contents/MacOS"
|
||||
end
|
||||
end
|
||||
|
||||
expose_app_to_path Ghostty
|
||||
expose_app_to_path WezTerm
|
||||
|
||||
# suppress greeting
|
||||
set fish_greeting
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
_: {
|
||||
programs.go = {
|
||||
enable = true;
|
||||
goPath = ".go";
|
||||
goPath = ".local/share/go";
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
toml = pkgs.formats.toml {};
|
||||
in {
|
||||
home.file.".cargo/config.toml".source = toml.generate "config.toml" {
|
||||
home.file."${config.xdg.dataHome}/cargo/config.toml".source = toml.generate "config.toml" {
|
||||
build.rustc-wrapper = "${lib.getExe' pkgs.sccache "sccache"}";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@ eval "$(/opt/homebrew/bin/brew shellenv)"
|
|||
# fnm shell env
|
||||
eval "$(fnm env --use-on-cd)"
|
||||
|
||||
# cargo
|
||||
export PATH="$CARGO_HOME/bin:$PATH"
|
||||
# go
|
||||
export PATH="$GOPATH/bin:$PATH"
|
||||
|
||||
# deno
|
||||
export PATH="$HOME/.deno/bin:$PATH"
|
||||
|
||||
# pnpm
|
||||
export PNPM_HOME="${HOME}/Library/pnpm"
|
||||
|
||||
# direnv
|
||||
export DIRENV_LOG_FORMAT=""
|
||||
|
||||
# docker
|
||||
export PATH="$HOME/.docker/bin:$PATH"
|
||||
export PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
# local bin
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
|
|
|||
|
|
@ -6,10 +6,12 @@ setopt auto_menu
|
|||
setopt complete_in_word
|
||||
setopt always_to_end
|
||||
|
||||
export HISTFILE="$XDG_STATE_HOME"/zsh/history
|
||||
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
||||
|
||||
# configure completion styles
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
|
||||
zstyle ':completion:*' group-name \'\'
|
||||
|
||||
function take() {
|
||||
|
|
@ -17,17 +19,6 @@ function take() {
|
|||
cd "$1" || return 1
|
||||
}
|
||||
|
||||
function clean_vscode_workspace_storage() {
|
||||
for i in "$HOME/Library/Application Support/Code/User/workspaceStorage/"*; do
|
||||
if [ -f $i/workspace.json ]; then
|
||||
older="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')";
|
||||
if [ -n "$folder" ] && [ ! -d "$folder" ]; then
|
||||
echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)"; rm -rfv "$i";
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# nix-your-shell
|
||||
eval "$(nix-your-shell zsh)"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue