Merge branch 'main' of codeberg.org:dnscio/nix-config
This commit is contained in:
commit
1d584074b0
8 changed files with 185 additions and 82 deletions
73
home/modules/aerospace/work.nix
Normal file
73
home/modules/aerospace/work.nix
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
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";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,5 +2,9 @@
|
|||
programs.atuin = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
style = "compact";
|
||||
inline_height = 20;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,98 +1,106 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{ programs.fish = {
|
||||
enable = true;
|
||||
|
||||
functions = {
|
||||
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/backend/backend-services/tariff-service -t d -d 1;
|
||||
fd . ~/dev/ride/apps/backend/backend-services/wallet-service -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)
|
||||
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
|
||||
cd $folder
|
||||
'';
|
||||
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/backend/backend-services/tariff-service -t d -d 1;
|
||||
fd . ~/dev/ride/apps/backend/backend-services/wallet-service -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);
|
||||
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
|
||||
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)
|
||||
# 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
|
||||
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 = ''
|
||||
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})'
|
||||
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
|
||||
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%
|
||||
# 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
|
||||
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
|
||||
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:#908caa,bg:#191724,hl:#ebbcba
|
||||
--color=fg+:#e0def4,bg+:#26233a,hl+:#ebbcba
|
||||
--color=border:#403d52,header:#31748f,gutter:#191724
|
||||
--color=spinner:#f6c177,info:#9ccfd8
|
||||
--color=pointer:#c4a7e7,marker:#eb6f92,prompt:#908caa"
|
||||
|
||||
command fzf
|
||||
'';
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
|
|
@ -110,11 +118,13 @@
|
|||
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
|
||||
'';
|
||||
|
||||
shellAbbrs = {
|
||||
|
|
|
|||
7
home/modules/nvim/config/ftdetect/fastlane.vim
Normal file
7
home/modules/nvim/config/ftdetect/fastlane.vim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
au BufNewFile,BufRead Appfile set ft=ruby
|
||||
au BufNewFile,BufRead Deliverfile set ft=ruby
|
||||
au BufNewFile,BufRead Fastfile set ft=ruby
|
||||
au BufNewFile,BufRead Gymfile set ft=ruby
|
||||
au BufNewFile,BufRead Matchfile set ft=ruby
|
||||
au BufNewFile,BufRead Snapfile set ft=ruby
|
||||
au BufNewFile,BufRead Scanfile set ft=ruby
|
||||
|
|
@ -6,7 +6,8 @@ local M = {}
|
|||
|
||||
function M.apply_to_config(config)
|
||||
if hn == "dnsc-work" then
|
||||
config.window_background_opacity = 0.9
|
||||
config.window_background_opacity = 0.975
|
||||
config.font_size = 19
|
||||
end
|
||||
|
||||
if hn == "dnsc-desktop" then
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@
|
|||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
}: {
|
||||
imports = [
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
../../home/modules/aerospace
|
||||
../../home/modules/aerospace/work.nix
|
||||
];
|
||||
|
||||
# Setting the user
|
||||
|
|
@ -44,6 +44,7 @@
|
|||
prettierd
|
||||
atuin
|
||||
nil
|
||||
nurl
|
||||
];
|
||||
|
||||
# Homebrew
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
enable = true;
|
||||
|
||||
onActivation = {
|
||||
autoUpdate = false;
|
||||
autoUpdate = true;
|
||||
cleanup = "zap";
|
||||
};
|
||||
|
||||
|
|
@ -68,7 +69,7 @@
|
|||
"yt-dlp"
|
||||
"zoxide"
|
||||
"sqlite"
|
||||
"rsync"
|
||||
# "rsync" -> Can't install due to: https://github.com/fastlane/fastlane/discussions/27962
|
||||
"fnm"
|
||||
"imagemagick"
|
||||
"todo-txt"
|
||||
|
|
@ -83,12 +84,13 @@
|
|||
"librsvg"
|
||||
"pixman"
|
||||
"python-setuptools"
|
||||
"rbenv"
|
||||
];
|
||||
|
||||
casks = [
|
||||
"arc"
|
||||
"microsoft-teams"
|
||||
"tailscale"
|
||||
# "tailscale"
|
||||
"font-victor-mono"
|
||||
"font-victor-mono-nerd-font"
|
||||
"vlc"
|
||||
|
|
@ -102,6 +104,8 @@
|
|||
"1password"
|
||||
"android-studio"
|
||||
"zulu@17"
|
||||
"postman"
|
||||
"docker"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
@ -130,6 +134,7 @@
|
|||
persistent-apps = [
|
||||
"/Applications/Arc.app"
|
||||
"/Applications/WezTerm.app"
|
||||
"/Applications/Microsoft Teams.app"
|
||||
"/System/Applications/System Settings.app/"
|
||||
];
|
||||
persistent-others = [
|
||||
|
|
@ -171,6 +176,7 @@
|
|||
home-manager = {
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
useGlobalPkgs = true;
|
||||
backupFileExtension = "backup";
|
||||
users = {
|
||||
dennis = import ../../home/darwin-work.nix;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue