1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2026-01-27 04:06:28 +01:00

refactor: use snowfall

This commit is contained in:
Ryan Cao 2024-02-10 11:56:31 +08:00
parent bb39b10e1f
commit de8503d9a6
Signed by: ryanccn
SSH key fingerprint: SHA256:NtP/BlVhoQq4xU6BEcZeT8nIPvHntkJ3lIc2yB+F09E
34 changed files with 181 additions and 194 deletions

View file

@ -0,0 +1,27 @@
# ls/exa/eza
set -x LS_COLORS (vivid generate catppuccin-frappe)
# 1Password SSH
set -x SSH_AUTH_SOCK "$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
# Nix
fish_add_path -Pm /etc/profiles/per-user/$USER/bin /run/current-system/sw/bin
# fnm shell env
fnm env --use-on-cd | source
# cargo
fish_add_path -P "$HOME/.cargo/bin"
# deno
fish_add_path -P "$HOME/.deno/bin"
# pnpm
set -x PNPM_HOME "$HOME/Library/pnpm"
# docker
fish_add_path -P "$HOME/.docker/bin"
# local bin
fish_add_path -P "$HOME/.local/bin"
# suppress greeting
set fish_greeting

View file

@ -0,0 +1,8 @@
if status is-interactive
# nix-your-shell
nix-your-shell fish | source
if test -e "$HOME/.iterm2_shell_integration.fish"
source "$HOME/.iterm2_shell_integration.fish"
end
end

View file

@ -0,0 +1,35 @@
{lib, ...}: let
aliases = import ../aliases;
shellAbbrs = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: !(b.fishAlias or false)) aliases);
shellAliases = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: builtins.hasAttr "fishAlias" b && b.fishAlias) aliases);
in {
programs.fish = {
enable = true;
inherit shellAbbrs shellAliases;
functions = {
take = ''
set dir $argv[1]
if test -z "$dir"
return 1
end
mkdir -p "$dir"
cd "$dir"
'';
code = ''
if test -d "$argv[1]" -o -f "$argv[1]"
open -a "Visual Studio Code" "$argv[1]"
else
command code $argv
end
'';
};
};
home.file.".config/fish/conf.d" = {
source = ./conf.d;
recursive = true;
};
}