Adds config for new work mac
This commit is contained in:
parent
b5ebffd469
commit
48ea1e8876
4 changed files with 293 additions and 1 deletions
25
home/darwin-work.nix
Normal file
25
home/darwin-work.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.username = "dennis";
|
||||
home.homeDirectory = "/Users/dennis";
|
||||
home.stateVersion = "24.11";
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
GOPATH = "$HOME/go";
|
||||
};
|
||||
|
||||
xdg.enable = true;
|
||||
|
||||
imports = [
|
||||
./modules/git
|
||||
./modules/fish/work
|
||||
./modules/atuin
|
||||
./modules/wezterm
|
||||
./modules/nvim
|
||||
./modules/lazygit
|
||||
];
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
echo "---"
|
||||
end
|
||||
'';
|
||||
localip = " ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
|
||||
localip = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
|
||||
publicip = "curl -4 ifconfig.me";
|
||||
};
|
||||
|
||||
|
|
|
|||
83
home/modules/fish/work.nix
Normal file
83
home/modules/fish/work.nix
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
functions = {
|
||||
ff = ''
|
||||
set RG_PREFIX "rg --column --line-number --no-heading --color=always --smart-case "
|
||||
set INITIAL_QUERY "$argv"
|
||||
fzf --ansi --disabled --query "$INITIAL_QUERY" \
|
||||
--bind "start:reload:$RG_PREFIX {q}" \
|
||||
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \
|
||||
--delimiter : \
|
||||
--preview 'bat --color=always {1} --highlight-line {2}' \
|
||||
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
|
||||
--bind 'enter:become(nvim {1} +{2})'
|
||||
'';
|
||||
envsource = ''
|
||||
for line in (cat $argv | grep -v '^#')
|
||||
set item (string split -m 1 '=' $line)
|
||||
set -gx $item[1] $item[2]
|
||||
end
|
||||
'';
|
||||
fish_greeting = "fortune -a";
|
||||
resize_images = ''
|
||||
# Resize all JPG images in the current directory and its subdirectories
|
||||
# Usage: resize_images [percentage]
|
||||
# Example: resize_images 20 - resizes all images to 20% of original size
|
||||
# If no percentage is provided, defaults to 40%
|
||||
|
||||
set -l percentage $argv[1]
|
||||
if test -z "$percentage"
|
||||
set percentage 40
|
||||
end
|
||||
|
||||
for img in (find . -type f -name "*.JPG")
|
||||
set original_size (stat -f %z "$img")
|
||||
magick convert "$img" -resize "$percentage%" "$img"
|
||||
set new_size (stat -f %z "$img")
|
||||
echo "Processed $img"
|
||||
echo "Original size: $original_size bytes"
|
||||
echo "New size: $new_size bytes"
|
||||
echo "---"
|
||||
end
|
||||
'';
|
||||
localip = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
|
||||
publicip = "curl -4 ifconfig.me";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
fish_config theme choose "Rosé Pine"
|
||||
|
||||
set -gx JAVA_HOME /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
|
||||
set -gx ANDROID_HOME /Users/dennis/Library/Android/sdk
|
||||
|
||||
set hn (prompt_hostname)
|
||||
set fish_cursor_default block blink
|
||||
set fish_cursor_insert line blink
|
||||
set fish_cursor_replace_one underscore blink
|
||||
set fish_cursor_visual block
|
||||
set fish_vi_force_cursor 1
|
||||
fish_vi_key_bindings
|
||||
|
||||
fish_add_path /run/current-system/sw/bin
|
||||
fish_add_path /opt/homebrew/bin
|
||||
fish_add_path $ANDROID_HOME/emulator
|
||||
fish_add_path $ANDROID_HOME/platform-tools
|
||||
|
||||
envsource ~/.env
|
||||
|
||||
zoxide init fish | source
|
||||
fnm env --use-on-cd --shell fish | source
|
||||
'';
|
||||
|
||||
shellAbbrs = {
|
||||
lg = "lazygit";
|
||||
g = "git";
|
||||
frc = "source ~/.config/fish/**/*.fish";
|
||||
t = "todo.sh";
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".config/fish/themes".source = ./themes;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue