removes work specific files uses unified modules

This commit is contained in:
Dennis Schoepf 2025-12-06 14:29:53 +01:00
parent 80c8cdef62
commit 8d24fc479e
12 changed files with 169 additions and 491 deletions

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
home.username = "dennis";
@ -15,11 +15,10 @@
imports = [
../modules/git
../modules/fish/work.nix
../modules/atuin
../modules/zoxide
../modules/fish
../modules/wezterm
../modules/nvim
../modules/lazygit
];
programs.home-manager.enable = true;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
home.username = "dennis";
@ -16,14 +16,10 @@
../modules/ssh
../modules/git
../modules/zoxide
../modules/atuin
../modules/fish
../modules/wezterm
../modules/nvim
../modules/lazygit
../modules/raycast
../modules/zellij
../modules/ghostty
../modules/zellij
];
programs.home-manager.enable = true;

View file

@ -1,9 +1,12 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
nix = {
package = pkgs.nix;
settings.experimental-features = [ "nix-command" "flakes" ];
settings.experimental-features = [
"nix-command"
"flakes"
];
};
nixpkgs = {
@ -33,7 +36,6 @@
lazygit
fortune
zoxide
atuin
fnm
gcc
];
@ -43,7 +45,6 @@
imports = [
../modules/git
../modules/fish
../modules/atuin
../modules/nvim/deck.nix
../modules/lazygit
];

View file

@ -1,4 +1,4 @@
{ _config, pkgs, inputs, ... }:
{ _config, pkgs, ... }:
{
home.username = "dennis";
@ -64,7 +64,10 @@
antialiasing = true;
defaultFonts = {
monospace = [ "VictorMono Nerd Font" ];
sansSerif = [ "Adwaita Sans" "Noto Color Emoji" ];
sansSerif = [
"Adwaita Sans"
"Noto Color Emoji"
];
serif = [ "Bodoni Moda" ];
};
};

View file

@ -1,15 +1,13 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}:
{
imports = [
inputs.home-manager.darwinModules.home-manager
../../modules/aerospace/work.nix
../../modules/aerospace
];
# Setting the user

View file

@ -69,22 +69,42 @@
"if".app-id = "app.zen-browser.zen";
run = "move-node-to-workspace 1";
}
{
"if".app-id = "company.thebrowser.Browser";
run = "move-node-to-workspace 1";
}
{
"if".app-id = "com.github.wez.wezterm";
run = "move-node-to-workspace 2";
}
{
"if".app-id = "com.mitchellh.ghostty";
run = "move-node-to-workspace 2";
}
{
"if".app-id = "com.apple.Preview";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.apple.dt.Xcode";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.postmanlabs.mac";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.apple.iCal";
run = "move-node-to-workspace 4";
}
{
"if".app-id = "com.spotify.client";
"if".app-id = "com.microsoft.teams2";
run = "move-node-to-workspace 5";
}
{
"if".app-id = "com.spotify.client";
run = "move-node-to-workspace 6";
}
{
"if".app-id = "com.apple.reminders";
run = "move-node-to-workspace 6";

View file

@ -1,91 +0,0 @@
{
services.aerospace = {
enable = true;
settings = {
accordion-padding = 25;
gaps = {
inner.horizontal = 6;
inner.vertical = 6;
outer.left = 6;
outer.bottom = 6;
outer.top = 6;
outer.right = 6;
};
workspace-to-monitor-force-assignment = {
"1" = "main";
"2" = "main";
"3" = "main";
"4" = "main";
"5" = "secondary";
"6" = "secondary";
};
mode.main.binding = {
alt-h = "focus left";
alt-j = "focus down";
alt-k = "focus up";
alt-l = "focus right";
alt-shift-h = "move left";
alt-shift-j = "move down";
alt-shift-k = "move up";
alt-shift-l = "move right";
alt-comma = "layout tiles horizontal vertical";
alt-period = "layout accordion horizontal vertical";
alt-f = "fullscreen";
alt-1 = "workspace 1";
alt-2 = "workspace 2";
alt-3 = "workspace 3";
alt-4 = "workspace 4";
alt-5 = "workspace 5";
alt-6 = "workspace 6";
alt-shift-1 = [
"move-node-to-workspace 1"
"workspace 1"
];
alt-shift-2 = [
"move-node-to-workspace 2"
"workspace 2"
];
alt-shift-3 = [
"move-node-to-workspace 3"
"workspace 3"
];
alt-shift-4 = [
"move-node-to-workspace 4"
"workspace 4"
];
alt-shift-5 = [
"move-node-to-workspace 5"
"workspace 5"
];
alt-shift-6 = [
"move-node-to-workspace 6"
"workspace 6"
];
alt-tab = "workspace-back-and-forth";
alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
};
on-window-detected = [
{
"if".app-id = "company.thebrowser.Browser";
run = "move-node-to-workspace 1";
}
{
"if".app-id = "com.github.wez.wezterm";
run = "move-node-to-workspace 2";
}
{
"if".app-id = "com.postmanlabs.mac";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.apple.dt.Xcode";
run = "move-node-to-workspace 3";
}
{
"if".app-id = "com.microsoft.teams2";
run = "move-node-to-workspace 5";
}
];
};
};
}

View file

@ -2,5 +2,6 @@
programs.direnv = {
enable = true;
nix-direnv.enable = true;
enableFishIntegration = true;
};
}

View file

@ -1,47 +1,20 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
programs.fish = {
enable = true;
functions = {
ff = "bash ${./ff.bash}";
fish_greeting = "fortune -a";
localip = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
publicip = "curl -4 ifconfig.me";
dbui = /* fish */ ''
nvim +"DBUI"
'';
ff = ''
bash ${./ff.bash}
kill_tunnels = /* fish */ ''
ps -o pid,command | grep "^[0-9]\{4,5\} ssh -NL" | awk '{print $1}' | xargs kill -9
'';
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";
fzf = ''
fzf = /* fish */ ''
set -Ux FZF_DEFAULT_OPTS "
--color=fg:#ffffff,bg:#0d0e1c,hl:#ef8386
--color=fg+:#ffffff,bg+:#1d2235,hl+:#ef8386
@ -51,32 +24,50 @@
command fzf
'';
zellij_session_delete = ''
if test -z "$argv[1]"
return
dev_projects = /* fish */ ''
if hn == "dnsc-work"
begin
fd . ~/dev/ride/apps/backend/edge-services -t d -d 1;
fd . ~/dev/ride/apps/backend/backend-services -t d -d 1;
fd . ~/dev/ride/apps/frontend/projects -t d -d 1;
fd . ~/dev/ride/apps/native -t d -d 1;
fd . ~/dev/ride/packages -t d -d 1;
echo "$HOME/dev/ride/apps/frontend";
echo "$HOME/dev/ride/apps/lib";
echo "$HOME/dev/ride/apps/packages";
echo "$HOME/dev/ride";
end
set -l session_name (basename $argv[1])
echo "delete $session_name"
'';
zellij_session_kill = ''
if test -z "$argv[1]"
return
else
fd . ~/dev -t d -d 1
end
'';
cdd = /* fish */ ''
set folder (dev_projects | fzf)
cd $folder
'';
cdr = /* fish */ ''
set folder (dev_projects | fzf)
cd $folder
set -l session_name (basename $argv[1])
echo "delete $session_name"
if test -n "$folder"
set service (basename $folder)
cd $folder
if test -f "package.json"
set script_cmd (jq -r '.scripts | to_entries | .[] | "\(.key): \(.value)"' package.json | fzf)
if test -n "$script_cmd"
set script_name (string split ": " $script_cmd)[1]
if test -n "$script_name"
echo "Running: npm run $script_name"
npm run $script_name
end
end
end
end
'';
zellij_session_fzf = ''
command fzf \
--prompt="Select project: " \
--header="Enter: Select | Ctrl+D: Delete Session | Ctrl+K: Kill Session" \
--bind="ctrl-d:execute(zellij_session_delete {})+reload($0 --generate-list)" \
--bind="ctrl-k:execute(zellij_session_kill {})+reload($0 --generate-list)"
'';
sessionizer = ''
set -l options (fd . $HOME/dev/ -t d -d 1)
set -l selected (options | zellij_session_fzf)
sessionizer = /* fish */ ''
set -l selected (dev_projects | fzf --prompt "Create/switch to session: ")
if test -z "$selected"
return 1
end
@ -89,7 +80,7 @@
zellij attach "$session_name" --create
end
'';
nn = ''
nn = /* fish */ ''
# Require a title argument
if test (count $argv) -lt 1
echo "Usage: nn \"My Note\""
@ -130,7 +121,7 @@
# Open file in neovim
nvim $fullpath
'';
fish_mode_prompt = ''
fish_mode_prompt = /* fish */ ''
switch $fish_bind_mode
case default
set_color --bold brcyan
@ -153,16 +144,7 @@
end
set_color normal
'';
};
interactiveShellInit = ''
set hn (prompt_hostname)
set fish_cursor_default block blink
fish_vi_key_bindings insert
bind ctrl-s sessionizer
# Custom Colorscheme
setup_winterly_theme_colors = /* fish */ ''
set --universal fish_color_autosuggestion brblack # autosuggestions
set --universal fish_color_command brwhite # commands
set --universal fish_color_comment brblack # code comments
@ -185,30 +167,65 @@
set --universal fish_color_host brwhite # current host system in some of fish default prompts
set --universal fish_color_host_remote yellow #ayu:syntax.constant current host system in some of fish default prompts, if fish is running remotely (via ssh or similar)
set --universal fish_color_user brwhite # current username in some of fish default prompts
set -x GPG_TTY (tty)
fish_add_path /run/wrappers/bin
fish_add_path /run/current-system/sw/bin
switch (uname)
case Darwin
'';
setup_homebrew = /* fish */ ''
fish_add_path /opt/homebrew/bin
if test -d (brew --prefix)"/share/fish/completions"
set -p fish_complete_path (brew --prefix)/share/fish/completions
end
if test -d (brew --prefix)"/share/fish/vendor_completions.d"
set -p fish_complete_path (brew --prefix)/share/fish/vendor_completions.d
end
'';
setup_path = /* fish */ ''
fish_add_path /run/wrappers/bin
fish_add_path /run/current-system/sw/bin
if uname == "Darwin"
setup_homebrew
end
'';
setup_env = /* fish */ ''
set -l user_env (cat $HOME/.env)
if test -z "$user_env"
echo "~/.env not found"
return 1
end
envsource ~/.env
for line in (user_env | grep -v '^#')
set item (string split -m 1 '=' $line)
set -gx $item[1] $item[2]
end
'';
setup_work = /* fish */ ''
fish_add_path $ANDROID_HOME/emulator
fish_add_path $ANDROID_HOME/platform-tools
rbenv init - | source
'';
};
zoxide init fish | source
direnv hook fish | source
interactiveShellInit = /* fish */ ''
# Set some global values
set -x GPG_TTY (tty)
set hn (prompt_hostname)
set fish_cursor_default block blink
fish_vi_key_bindings insert
setup_winterly_theme_colors
setup_env
setup_path
if hn == "dnsc-work"
setup_work
end
# Third party integration not covered by
# home manager's enableFishIntegration
fnm env --use-on-cd --shell fish | source
# Temporary fix because of https://github.com/atuinsh/atuin/issues/2803
# atuin init fish | sed 's/-k up/up/' | source
'';
shellAbbrs = {

View file

@ -1,266 +0,0 @@
{ _config, _pkgs, ... }:
{
programs.fish = {
enable = true;
functions = {
dbui = ''
nvim +"DBUI"
'';
cdr = ''
set folder (begin
fd . ~/dev/ride/apps/backend/edge-services -t d -d 1;
fd . ~/dev/ride/apps/backend/backend-services -t d -d 1;
fd . ~/dev/ride/apps/frontend/projects -t d -d 1;
fd . ~/dev/ride/apps/native -t d -d 1;
fd . ~/dev/ride/packages -t d -d 1;
echo "$HOME/dev/ride/apps/frontend";
echo "$HOME/dev/ride/apps/lib";
echo "$HOME/dev/ride";
end | fzf);
set service (basename $folder)
cd $folder
'';
cdn = ''
set folder (begin
fd . ~/dev/ride/apps/backend/edge-services -t d -d 1;
fd . ~/dev/ride/apps/backend/backend-services -t d -d 1;
fd . ~/dev/ride/apps/frontend/projects -t d -d 1;
fd . ~/dev/ride/apps/native -t d -d 1;
fd . ~/dev/ride/packages -t d -d 1;
echo "$HOME/dev/ride/apps/frontend";
echo "$HOME/dev/ride/apps/lib";
echo "$HOME/dev/ride";
end | fzf);
set service (basename $folder)
cd $folder
nvim +"lua Snacks.picker.files({ hidden = true })"
'';
cdf = ''
set folder (begin
fd . ~/dev/ride/apps/backend/edge-services -t d -d 1;
fd . ~/dev/ride/apps/backend/backend-services -t d -d 1;
fd . ~/dev/ride/apps/frontend/projects -t d -d 1;
fd . ~/dev/ride/apps/native -t d -d 1;
fd . ~/dev/ride/packages -t d -d 1;
echo "$HOME/dev/ride/apps/frontend";
echo "$HOME/dev/ride/apps/lib";
echo "$HOME/dev/ride";
end | fzf);
set service (basename $folder)
cd $folder
bash ${./ff.bash}
'';
rr = ''
set folder (begin
fd . ~/dev/ride/apps/backend/edge-services -t d -d 1;
fd . ~/dev/ride/apps/backend/backend-services -t d -d 1;
fd . ~/dev/ride/apps/frontend/projects -t d -d 1;
fd . ~/dev/ride/apps/native -t d -d 1;
echo "$HOME/dev/ride/apps/frontend";
echo "$HOME/dev/ride/apps/lib";
echo "$HOME/dev/ride";
end | fzf);
if test -n "$folder"
set service (basename $folder)
cd $folder
# Check if package.json exists
if test -f "package.json"
# Extract and format npm scripts for fzf
set script_cmd (jq -r '.scripts | to_entries | .[] | "\(.key): \(.value)"' package.json | fzf)
if test -n "$script_cmd"
# Extract just the script name before the colon
set script_name (string split ": " $script_cmd)[1]
if test -n "$script_name"
echo "Running: npm run $script_name"
npm run $script_name
end
end
end
end
'';
ff = ''
bash ${./ff.bash}
'';
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";
fzf = ''
set -Ux FZF_DEFAULT_OPTS "
--color=fg:#ffffff,bg:#0d0e1c,hl:#ef8386
--color=fg+:#ffffff,bg+:#1d2235,hl+:#ef8386
--color=border:#61647a,header:#88ca9f,gutter:#0d0e1c
--color=spinner:#fec43f,info:#00bcff
--color=pointer:#feacd0,marker:#ff5f59,prompt:#9ac8e0"
command fzf
'';
dbui_stg = ''
kill_tunnels && ssh -NL 4321:192.168.0.168:3306 otc & nvim +DBUI
'';
dbui_prod = ''
kill_tunnels && ssh -NL 4322:192.168.0.38:3306 otc-prod & nvim +DBUI
'';
kill_tunnels = ''
ps -o pid,command | grep "^[0-9]\{4,5\} ssh -NL" | awk '{print $1}' | xargs kill -9
'';
pr_comments = ''
gh api repos/digital-h-gmbh/ride/pulls/$argv/comments | jq -r '.[] | "- [ ] Fix \nnvim +\(.line) \(.path)\n\"\(.body)\"\n\n"' >./pr-comments.md && nvim ./pr-comments.md
'';
nn = ''
# Require a title argument
if test (count $argv) -lt 1
echo "Usage: nn \"My Note\""
return 1
end
# Join all arguments into single title (preserves spaces inside quotes)
set -l title $argv[1]
# Timestamp up to minutes, format: YYYY-MM-DD_HH-MM
set -l ts (date "+%Y%m%d%H%M")
# Normalize title: lowercase, replace spaces with hyphens, remove/replace
# characters unsafe for filenames (keep a-z0-9- and replace others with -)
set -l slug (string lower -- $title)
# Replace any sequence of non-alphanumeric characters with single hyphen
set -l slug (echo $slug | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/^-|-$//g')
# Compose filename
set -l filename "$ts"_"$slug.md"
# Directory for notes (change if you prefer another path)
set -l notes_dir ~/notes
# Ensure directory exists
test -d $notes_dir; or mkdir -p $notes_dir
# Full path
set -l fullpath "$notes_dir/$filename"
# If file doesn't exist, create with timestamp and title at top
if not test -f $fullpath
# Human-friendly timestamp line (no seconds)
set -l display_ts (date "+%Y-%m-%d %H:%M")
printf "---\nCREATED_AT: %s\n---\n\n# %s\n\n" "$display_ts" "$title" > $fullpath
end
# Open file in neovim
nvim $fullpath
'';
fish_mode_prompt = ''
switch $fish_bind_mode
case default
set_color --bold blue
echo '[N] '
case insert
set_color --bold green
echo '[I] '
case replace_one
set_color --bold green
echo '[R] '
case replace
set_color --bold bryellow
echo '[R] '
case visual
set_color --bold brmagenta
echo '[V] '
case '*'
set_color --bold red
echo '[?] '
end
set_color normal
'';
};
interactiveShellInit = ''
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
# Custom Colorscheme
set --universal fish_color_autosuggestion brblack # autosuggestions
set --universal fish_color_command brwhite # commands
set --universal fish_color_comment brblack # code comments
set --universal fish_color_cwd brblack # current working directory in the default prompt
set --universal fish_color_end brblack # process separators like ';' and '&'
set --universal fish_color_error brwhite # highlight potential errors
set --universal fish_color_escape brblack # highlight character escapes like '\n' and '\x70'
set --universal fish_color_match yellow # highlight matching parenthesis
set --universal fish_color_normal brwhite # default color
set --universal fish_color_operator brblack # parameter expansion operators like '*' and '~'
set --universal fish_color_param brmagenta # regular command parameters
set --universal fish_color_quote bryellow # quoted blocks of text
set --universal fish_color_redirection brwhite # IO redirections
set --universal fish_color_search --bold --background=black --foreground=bryellow
set --universal fish_color_search_match --background black # highlight history search matches and the selected pager item (must be a background)
set --universal fish_pager_color_selected_background --background black --foreground brmagenta
set --universal fish_pager_color_progress --foreground=brwhite --background=black
set --universal fish_color_selection --background magenta # when selecting text (in vi visual mode)
set --universal fish_color_cancel brblack # the '^C' indicator on a canceled command
set --universal fish_color_host brwhite # current host system in some of fish default prompts
set --universal fish_color_host_remote yellow #ayu:syntax.constant current host system in some of fish default prompts, if fish is running remotely (via ssh or similar)
set --universal fish_color_user brwhite # current username in some of fish default prompts
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
fish_add_path $HOME/.config/fish/plugins
envsource ~/.env
zoxide init fish | source
fnm env --use-on-cd --shell fish | source
rbenv init - | source
# Temporary fix because of https://github.com/atuinsh/atuin/issues/2803
atuin init fish | sed 's/-k up/up/' | source
'';
shellAbbrs = {
lg = "nvim +Neogit";
gg = "nvim +Neogit";
gco = "git checkout";
frc = "source ~/.config/fish/**/*.fish";
};
};
}

View file

@ -8,8 +8,8 @@
font-family = "Victor Mono";
font-style = "SemiBold";
background-opacity = 0.945;
window-padding-x = 12;
window-padding-y = 12;
window-padding-x = 0;
window-padding-y = 0;
window-padding-balance = true;
window-inherit-working-directory = true;
window-theme = "ghostty";

View file

@ -1,6 +1,6 @@
{
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
};
}