This is a project to help me to manage my Nix system configuration, mainly with Darwin and Home Manager.
Best effort to try to use as many built-in features as possible instead of relying third party software, e.g. Raycast, Aerospace, Yabai
- Shell: fish
- Terminal: ghostty
- Editor: neovim
- Multiplexer: tmux
- Prompt: starship
- Browser: Safari
- Docker: orbstack
- Network: tailscale
- Launcher: Built-in Spotlight Search
- Window Tiling Manager:
aerospaceMacOS Bulit-ins- Changing spaces with built-in macos commands with reduced motion
- Managing windows with built-in macos commands
- Left | Right | Top | Bottom | Fill
- Automation: hammerspoon
https://nixos.org/download#nix-install-macos
sh <(curl -L https://nixos.org/nix/install)
scutil --get LocalHostName
whoami
chsh -s (which fish)
The following script will initialise the function above and install additional node packages too.
bash ~/nix-system-config-v2/scripts/init.sh
// run this at the root of this directory
nix run nix-darwin -- switch --flake ~/nix-system-config-v2/.#Kyles-MacBook-Air
darwin-rebuild switch --flake ~/nix-system-config-v2
// https://github.com/NixOS/nix/issues/2899#issuecomment-1669501326
sudo rm /etc/ssl/certs/ca-certificates.crt
sudo ln -s /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
### Cleanup
```bash
// Cleanup nix
bash ~/nix-system-config-v2/scripts/nix-cleanup.sh
// Cleanup neovim
bash ~/nix-system-config-v2/scripts/nvim-reset.sh
nix config check
If there's multiple nix in the path, it is from the nix root, run the following the remove it.
sudo -i nix-env -e nix
// https://github.com/NixOS/nix/issues/2982#issuecomment-539794642
sudo -i nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
sudo -i nix-channel --update nixpkgs
bash ~/nix-system-config-v2/scripts/install-node-packages.sh
Navigate to ...../modules/home-manager/node-packages
and run the following command to generate a nix expression. The expression can then be added into home manager
-18
is to build with nodejs v18
nix-shell -p nodePackages.node2nix --command "node2nix -18 -i ./node-packages.json -o node"
https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/releases/download/v3.1.0/Karabiner-DriverKit-VirtualHIDDevice-3.1.0.pkg
// Activate
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
// Restart kanata
sudo launchctl unload /Library/LaunchDaemons/org.nixos.kanata.plist
sudo launchctl load /Library/LaunchDaemons/org.nixos.kanata.plist