Switching from yabai to aerospace; moved module nix files to directory

This commit is contained in:
Random936
2024-11-01 21:53:46 -07:00
parent 830e426bd1
commit e8b184b4ae
9 changed files with 112 additions and 108 deletions

View File

@@ -0,0 +1,88 @@
{ ... }: {
home.file.".aerospace.toml".text = ''
# Reference: https://github.com/i3/i3/blob/next/etc/config
# i3 doesn't have "normalizations" feature that why we disable them here.
# But the feature is very helpful.
# Normalizations eliminate all sorts of weird tree configurations that don't make sense.
# Give normalizations a chance and enable them back.
enable-normalization-flatten-containers = false
enable-normalization-opposite-orientation-for-nested-containers = false
# Mouse follows focus when focused monitor changes
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
[mode.main.binding]
# See: https://nikitabobko.github.io/AeroSpace/goodness#open-a-new-window-with-applescript
alt-enter = '''exec-and-forget osascript -e '
tell application "Terminal"
do script
activate
end tell'
'''
# i3 wraps focus by default
alt-j = 'focus --boundaries-action wrap-around-the-workspace left'
alt-k = 'focus --boundaries-action wrap-around-the-workspace down'
alt-l = 'focus --boundaries-action wrap-around-the-workspace up'
alt-semicolon = 'focus --boundaries-action wrap-around-the-workspace right'
alt-shift-j = 'move left'
alt-shift-k = 'move down'
alt-shift-l = 'move up'
alt-shift-semicolon = 'move right'
# Consider using 'join-with' command as a 'split' replacement if you want to enable normalizations
alt-h = 'split horizontal'
alt-v = 'split vertical'
alt-f = 'fullscreen'
alt-s = 'layout v_accordion' # 'layout stacking' in i3
alt-w = 'layout h_accordion' # 'layout tabbed' in i3
alt-e = 'layout tiles horizontal vertical' # 'layout toggle split' in i3
alt-shift-space = 'layout floating tiling' # 'floating toggle' in i3
# Not supported, because this command is redundant in AeroSpace mental model.
# See: https://nikitabobko.github.io/AeroSpace/guide#floating-windows
#alt-space = 'focus toggle_tiling_floating'
# `focus parent`/`focus child` are not yet supported, and it's not clear whether they
# should be supported at all https://github.com/nikitabobko/AeroSpace/issues/5
# alt-a = 'focus parent'
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-7 = 'workspace 7'
alt-8 = 'workspace 8'
alt-9 = 'workspace 9'
alt-0 = 'workspace 10'
alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'
alt-shift-7 = 'move-node-to-workspace 7'
alt-shift-8 = 'move-node-to-workspace 8'
alt-shift-9 = 'move-node-to-workspace 9'
alt-shift-0 = 'move-node-to-workspace 10'
alt-shift-c = 'reload-config'
alt-r = 'mode resize'
[mode.resize.binding]
h = 'resize width -50'
j = 'resize height +50'
k = 'resize height -50'
l = 'resize width +50'
enter = 'mode main'
esc = 'mode main'
'';
}

56
home/modules/emacs.nix Normal file
View File

@@ -0,0 +1,56 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
# Build deps
cmake
libtool
# Additional packages for functionality
isync
ispell
ledger
mu
# Fonts
maple-mono
# LSP Servers
nil
ccls
rust-analyzer
yaml-language-server
python3Packages.python-lsp-server
nodePackages.typescript-language-server
nodePackages.vscode-json-languageserver
];
programs = {
# For integration with shell.nix files
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
emacs = {
enable = true;
package = pkgs.emacs29;
extraPackages = epkgs: with epkgs; [
mu4e
vterm
all-the-icons
nerd-icons
];
};
};
home.file = {
".emacs".source = ../../dotfiles/.emacs;
".emacs.d/config.org".source = ../../dotfiles/.emacs.d/config.org;
".emacs.d/terminal.org".source = ../../dotfiles/.emacs.d/terminal.org;
".emacs.d/functions.org".source = ../../dotfiles/.emacs.d/functions.org;
".emacs.d/email.org".source = ../../dotfiles/.emacs.d/email.org;
".emacs.d/org.org".source = ../../dotfiles/.emacs.d/org.org;
".emacs.d/lsp.org".source = ../../dotfiles/.emacs.d/lsp.org;
".mbsyncrc".source = ../../dotfiles/.mbsyncrc;
};
}

37
home/modules/hacking.nix Normal file
View File

@@ -0,0 +1,37 @@
{ lib, config, pkgs, ... }:
let
mypkgs = import ../packages/all-packages.nix {
inherit pkgs lib config;
};
in {
# Hacking specific packages.
home.packages = (with pkgs; [
yara
nmap
john
ffuf
amass
nikto
sqlmap
wpscan
openssl
remmina
netexec
inetutils
thc-hydra
exploitdb
responder
burpsuite
feroxbuster
(wordlists.override {
lists = with pkgs; [
rockyou
seclists
];
})
]) ++ (with mypkgs; [
evil-winrm
binaryninja
]);
}

61
home/modules/neovim.nix Normal file
View File

@@ -0,0 +1,61 @@
{ pkgs, ... }: {
programs.neovim = {
enable = true;
vimAlias = true;
coc = {
enable = true;
settings = {
"diagnostic.checkCurrentLine" = true;
};
};
plugins = with pkgs.vimPlugins; [
supertab
nvim-fzf
vim-airline
# COC packages.
coc-sh
coc-css
coc-html
coc-json
coc-yaml
coc-svelte
coc-clangd
coc-docker
coc-tsserver
coc-rust-analyzer
];
extraConfig = ''
" Better smart indenting.
set formatoptions-=cro
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nu
set relativenumber
set nohlsearch
set hidden
set incsearch
set scrolloff=8
set colorcolumn=80
set signcolumn=yes
" Remove arrow keys to train my fingers
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
" FZF key bindings
nnoremap <leader>pf <cmd>Files<cr>
nnoremap <leader>pg <cmd>Rg<cr>
" Supertab start at top of completion list
let g:SuperTabContextDefaultCompletionType = "<c-n>"
'';
};
}

70
home/modules/zsh.nix Normal file
View File

@@ -0,0 +1,70 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
meslo-lgs-nf
];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history.size = 100000000;
shellAliases = {
cd = "z";
ls = "eza";
awkuniq = "sort | uniq";
histogram = "awkuniq -c | sort -nr";
json-less = "jq -C . | less -M";
csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'";
# Nix Specific aliases
update-darwin = "darwin-rebuild switch --flake ~/dotfiles";
update-config = "sudo nixos-rebuild switch --flake ~/dotfiles";
update-home = "home-manager switch --flake ~/dotfiles";
update-all = "update-config && update-home";
};
initExtraBeforeCompInit = ''
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
'';
initExtra = ''
export PATH=$PATH:~/.cargo/bin
function .. { cd .. }
function ... { cd ../.. }
function .... { cd ../../.. }
function ..... { cd ../../../../.. }
function ...... { cd ../../../../../.. }
function ....... { cd ../../../../../../.. }
function bw-copy { bw-load && bw get password "$1" | xsel --clipboard -i }
function bw-clear { echo -n "" | xsel --clipboard }
if [[ "$(uname)" == "Darwin" ]]; then
source <(/opt/homebrew/bin/brew shellenv)
fi
'';
plugins = [
{
name = "custom-functions";
src = ../../dotfiles;
file = ".functions.zsh";
}
{
name = "powerlevel10k-config";
src = ../../dotfiles;
file = ".p10k.zsh";
}
];
zplug = {
enable = true;
plugins = [
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
];
};
};
}