Compare commits

..

17 Commits

  1. 10
      README.md
  2. 16
      nix-darwin/configuration.nix
  3. 96
      nix-darwin/home.nix
  4. 78
      nix-darwin/modules/skhd.nix
  5. 40
      nix-darwin/modules/yabai.nix

@ -22,4 +22,14 @@ Then use [stow](https://www.gnu.org/software/stow/) to create symlinks for each
**i.e.** `$ stow -S vim` **i.e.** `$ stow -S vim`
### Anything nix related
I use [nix: home-manager](https://github.com/nix-community/home-manager). I suggest you do too. `stow` is fine until it isn't.
If you want to try out my nix config, then you can do this:
```sh
home-manager switch --flake .#elal
```
Be sure that your hostname is `exa` and your username is `elal`.
I suggest you change the above to **your** hostname and **your** username.

@ -1,16 +0,0 @@
{ pkgs, ... }:
{
# System-wide configuration
environment.systemPackages = with pkgs; [
# Add any system-wide packages here
];
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
system.defaults.dock.autohide = true;
system.defaults.finder.AppleShowAllExtensions = true;
# Add more system configurations as needed
}

@ -37,6 +37,12 @@
}; };
}; };
imports = [
# Modules
./modules/yabai.nix
./modules/skhd.nix
];
# The home.packages option allows you to install Nix packages into your # The home.packages option allows you to install Nix packages into your
# environment. # environment.
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -73,6 +79,55 @@
jq jq
tmux tmux
htop htop
sshfs
# Cringe
pfetch
neofetch
# Tools
nmap
dig
# Development stuff
gh
# c/c++
gcc
# haskell
ghc
# rust
rustc
rustup
# js/ts/node/web
nodejs_22
nodePackages.pnpm
# golang
go
# lua <3
lua
# ruby
ruby
# julia
julia_19-bin # compat
# py
python3
python312Packages.pip
# DE/WM/Ricing
yabai # wm
skhd # key mngr
# Fonts
nerdfonts
]; ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
@ -81,6 +136,7 @@
# # Building this configuration will create a copy of 'dotfiles/screenrc' in # # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a # # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy. # # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc; # ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately. # # You can also set the file content immediately.
@ -133,15 +189,55 @@
programs.zsh = { programs.zsh = {
enable = true; enable = true;
shellAliases = {
dev = "cd $HOME/Projects/almtech/exa/";
xcopy = "pbcopy";
xpaste = "pbpaste";
ccd = "echo $PWD | xcopy";
cr = "cd $(git rev-parse --show-toplevel)";
};
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
theme = "half-life"; theme = "half-life";
plugins = [ "git" "macos" ]; plugins = [ "git" "macos" ];
extraConfig = ''
# Homebrew
export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH"
# Nix
if [ -e /etc/profile.d/nix.sh ]; then . /etc/profile.d/nix.sh; fi
# TERM
export TERM=xterm-xfree86
'';
}; };
}; };
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;
settings = {
font = {
normal = {
family = "Hack Nerd Font";
style = "Regular";
};
bold = {
family = "Hack Nerd Font";
style = "Bold";
};
italic = {
family = "Hack Nerd Font";
style = "Italic";
};
size = 12;
};
window = {
padding = {
x = 8;
y = 8;
};
};
};
}; };
programs.neovim = { programs.neovim = {

@ -0,0 +1,78 @@
{ config, pkgs, ... }:
let
termPath = "/Applications/Alacritty.app";
browserPath = "/Applications/Firefox.app";
in
{
home.file.".skhdrc" = {
executable = true;
text = ''
# Mod1 is alt, Mod4 is cmd
# Terminal
cmd - return : open -n ${termPath}
# dmenu equivalent (you may want to install choose-gui or another launcher)
cmd - p : open -n /Applications/choose-gui.app
# Close window
cmd + shift - c : yabai -m window --close
# Focus window
cmd - j : yabai -m window --focus south
cmd - k : yabai -m window --focus north
cmd - h : yabai -m window --focus west
cmd - l : yabai -m window --focus east
# Move window
shift + cmd - j : yabai -m window --swap south
shift + cmd - k : yabai -m window --swap north
shift + cmd - h : yabai -m window --swap west
shift + cmd - l : yabai -m window --swap east
# Resize window
shift + alt - h : yabai -m window --resize left:-50:0 ; yabai -m window --resize right:-50:0
shift + alt - j : yabai -m window --resize bottom:0:50 ; yabai -m window --resize top:0:50
shift + alt - k : yabai -m window --resize top:0:-50 ; yabai -m window --resize bottom:0:-50
shift + alt - l : yabai -m window --resize right:50:0 ; yabai -m window --resize left:50:0
# Toggle floating
shift + alt - space : yabai -m window --toggle float
# Make window fullscreen
alt - f : yabai -m window --toggle zoom-fullscreen
# Toggle between layouts
alt - space : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end')
# Focus workspace
cmd - 1 : yabai -m space --focus 1
cmd - 2 : yabai -m space --focus 2
cmd - 3 : yabai -m space --focus 3
cmd - 4 : yabai -m space --focus 4
cmd - 5 : yabai -m space --focus 5
cmd - 6 : yabai -m space --focus 6
cmd - 7 : yabai -m space --focus 7
cmd - 8 : yabai -m space --focus 8
cmd - 9 : yabai -m space --focus 9
# Move window to workspace
shift + cmd - 1 : yabai -m window --space 1
shift + cmd - 2 : yabai -m window --space 2
shift + cmd - 3 : yabai -m window --space 3
shift + cmd - 4 : yabai -m window --space 4
shift + cmd - 5 : yabai -m window --space 5
shift + cmd - 6 : yabai -m window --space 6
shift + cmd - 7 : yabai -m window --space 7
shift + cmd - 8 : yabai -m window --space 8
shift + cmd - 9 : yabai -m window --space 9
# Restart yabai
shift + cmd - q : yabai --restart-service
# Start browser
cmd - b : open -n ${browserPath}
'';
};
}

@ -0,0 +1,40 @@
{ config, pkgs, ... }:
let
split_ratio = "0.50";
gap_padding = "16";
in
{
# Create configuration files for yabai and skhd
home.file.".yabairc" = {
executable = true;
text = ''
#!/usr/bin/env sh
# load scripting addition
sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
# global settings
yabai -m config layout bsp
yabai -m config window_placement second_child
yabai -m config split_ratio ${split_ratio}
yabai -m config auto_balance on
# Set all padding and gaps
yabai -m config top_padding ${gap_padding}
yabai -m config bottom_padding ${gap_padding}
yabai -m config left_padding ${gap_padding}
yabai -m config right_padding ${gap_padding}
yabai -m config window_gap ${gap_padding}
# mouse stuff
# yabai -m config mouse_follows_focus on
yabai -m config focus_follows_mouse autofocus
yabai -m config mouse_modifier cmd
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
'';
};
}
Loading…
Cancel
Save