https://github.com/birkhofflee/dotfiles
birkhoff's macOS dotfiles with nix
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.1%) to scientific vocabulary
Keywords
Repository
birkhoff's macOS dotfiles with nix
Basic Info
Statistics
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
dotfiles
My macOS dotfiles managed by nix-darwin and home-manager, powered by Nix.
Works on M1 Pro, macOS Sequoia 15.5 (24F74).
Overview
- nix-darwin sets up the macOS system environment.
- Nix enables reproducible builds.
- home-manager manages the user environment, including Homebrew packages.
- Most GUI apps are managed by Homebrew due to the conflicting nature of Nix and their self-updating capabilities
Key features:
- Ghostty as the terminal emulator, config: ghostty.nix
- zsh with powerlevel10k
- Prompt theme is p10k Lean style. Git status symbols docs can be found here.
- Helix keymap with Multirious/zsh-helix-mode
- Terminal Multiplexer:
- Zellij Unlock-First (non-colliding) preset with minor customization
- tmux configuration from gpakosz/.tmux
- atuin for shell history
- A number of handy aliases and functions
- fzf shell integration
- CTRL-T - Paste the path of selected files and directories onto the command-line
- ALT-C - cd into the selected directory
- fzf-tab for zsh completion, including a smart preview window:
- automatically propagated shell proxy settings
- Sets a beautiful wallpaper from Raycast
- git utilities include lazygit and forgit because I'm lazy
- zsh-you-should-use to remind me using shell aliases
- nix-index-database to locate the Nix package of a command, and comma to run the command without installing it.
Usage
On a new macOS machine without Nix installed:
```console xcode-select --install
Clone the dotfiles
mkdir $HOME/.config git clone https://github.com/birkhofflee/dotfiles $HOME/.config/nix
Install nix with Determinate Systems installer
Choose "no" to use the upstream nix instead of their own one
curl -fsSL https://install.determinate.systems/nix | sh -s -- install
Source the nix daemon so that the nix command is available immediately
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
Build the dotfiles
nix build "$HOME/.config/nix#darwinConfigurations.AlexMBP.system" --extra-experimental-features "nix-command flakes"
Apply the dotfiles
sudo ./result/sw/bin/darwin-rebuild switch --flake "$HOME/.config/nix#AlexMBP"
Optionally, delete the build artifacts
rm -rf ./result ```
After first successful deployment, use the following command to switch:
```console
This only switchs to the latest config
nh darwin switch --hostname AlexMBP "$HOME/.config/nix"
This updates all flake inputs and switches to the latest config
nh darwin switch --update --hostname AlexMBP "$HOME/.config/nix"
This updates one flake input and switches to the latest config
nh darwin switch --update-input
To clean up:
console
nh clean all
[!IMPORTANT] The following steps were applicable to installations with the original Nix installer. It is unknown whether they are needed to follow for a Determinate Systems installation.
After a major macOS update:
- Upgrade Xcode CLI tools
- Uninstall nix: https://nix.dev/manual/nix/2.18/installation/uninstall.html#macos
- A system restart may be required
- Review CHANGELOG of nix-darwin
```console
Install nix
bash <(curl -L https://nixos.org/nix/install) --daemon --yes --no-modify-profile
Propagate /run
printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t
Fix certs (the uninstallation of nix breaks a symbolic link)
https://github.com/NixOS/nix/issues/2899#issuecomment-1669501326
https://discourse.nixos.org/t/ssl-ca-cert-error-on-macos/31171/1
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
nix build "$HOME/.config/nix#darwinConfigurations.AlexMBP.system" --extra-experimental-features "nix-command flakes"
sudo ./result/sw/bin/darwin-rebuild switch --flake "$HOME/.config/nix#AlexMBP" ```
TODOs
- File completion
- List directories first like this
- When completing with fzf-tab, there's the slash in file names which i dont like
- Home Manager: dotfiles management
- Use XDG Base Directory Specification to ensure consistency across different platforms
Some other dotfiles worth looking into:
- https://github.com/malob/nixpkgs
- https://github.com/ahmedelgabri/dotfiles
- https://github.com/kornicameister/dotfiles/
- https://github.com/Aloxaf/dotfiles/tree/master/zsh/.config/zsh
- https://github.com/paulmillr/dotfiles
- https://github.com/marlonrichert/zsh-launchpad
- https://github.com/mashehu/dotfiles/blob/master/zshrc
Some completions setups:
- https://github.com/finnurtorfa/zsh/blob/master/completion.zsh
Articles
Here are some reads you might find interesting:
- Declarative macOS Configuration Using nix-darwin And home-manager
- Faster and enjoyable ZSH (maybe)
- Comparison of ZSH frameworks and plugin managers
- fzf examples (fzf wiki)
License
This project is released under The Unlicense.
Owner
- Name: birkhoff
- Login: BirkhoffLee
- Kind: user
- Location: Taipei City, Taiwan
- Website: https://birkhoff.me
- Twitter: birkhofflee
- Repositories: 165
- Profile: https://github.com/BirkhoffLee
backend, SRE, devops, music
GitHub Events
Total
- Watch event: 5
- Push event: 55
Last Year
- Watch event: 5
- Push event: 55
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Birkhoff Lee | g****t@b****e | 449 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- ack *
- asciinema *
- atk *
- automake *
- autossh *
- awscli *
- azure-cli *
- b2-tools *
- bash *
- bat *
- bfg *
- binutils *
- binwalk *
- bison *
- blueutil *
- bramstein/webfonttools/sfnt2woff *
- bramstein/webfonttools/sfnt2woff-zopfli *
- caddy,restart_service:true *
- cairo *
- carthage *
- certbot *
- chezmoi *
- cifer *
- cjbassi/ytop/ytop *
- coreutils *
- cowsay *
- create-dmg *
- ctags *
- curl *
- derailed/k9s/k9s *
- dex2jar *
- diff-so-fancy *
- difftastic *
- dns2tcp *
- dockutil *
- entr *
- exa *
- fabianishere/personal/pam_reattach *
- fasd *
- fd *
- ffmpeg *
- flarectl *
- foremost *
- freetds *
- fstrm *
- gdbm *
- gdk-pixbuf *
- gh *
- ghostscript *
- git *
- git-delta *
- git-lfs *
- glib *
- gmp *
- gnu-sed *
- gnu-tar *
- gnupg *
- gnutls *
- go *
- gobject-introspection *
- gocr *
- gotop *
- grep *
- gsettings-desktop-schemas *
- gtk+ *
- gtk+3 *
- harfbuzz *
- hashicorp/tap/nomad *
- hashicorp/tap/packer *
- hashpump *
- helm *
- hey *
- hopenpgp-tools *
- hstr *
- htop *
- httpie *
- hub *
- hugo *
- hydra *
- imagemagick *
- iperf3 *
- jc *
- jq *
- knock *
- krb5 *
- kubectx *
- kustomize *
- ldns *
- libass *
- libffi *
- libfido2 *
- libheif *
- libimagequant *
- libimobiledevice *
- libirecovery *
- libpq *
- libproxy *
- libraqm *
- libsodium *
- libssh *
- libyaml *
- locateme *
- lolcat *
- lsd *
- lua *
- lux *
- lynx *
- m-cli *
- macvim *
- magic-wormhole *
- mas *
- mitmproxy *
- mosh *
- mtr *
- mysql-client *
- ncdu *
- neofetch *
- netpbm *
- ninja *
- nmap *
- node *
- noti *
- nss *
- numpy *
- oci-cli *
- ocrad *
- opensc *
- openssh *
- openssl@1.1 *
- optipng *
- osx-cpu-temp *
- p11-kit *
- pango *
- php,restart_service:true *
- pigz *
- pillow *
- pinentry *
- pinentry-mac *
- pngcheck *
- procs *
- protobuf-c *
- putty *
- pv *
- python@3.10 *
- python@3.8 *
- python@3.9 *
- qt *
- r *
- rbenv *
- reattach-to-user-namespace *
- redis *
- rename *
- rlwrap *
- ruby *
- ruby-install *
- screen *
- skaffold *
- sleepwatcher,restart_service:true *
- slides *
- socat *
- sqlmap *
- srt *
- ssh-copy-id *
- sslscan *
- stress *
- subversion *
- tcl-tk *
- tcpflow *
- tcping *
- tcpreplay *
- tcptrace *
- tcptraceroute *
- teamookla/speedtest/speedtest *
- telnet *
- terminal-notifier *
- terraform *
- terraformer *
- testssl *
- the_silver_searcher *
- tmux *
- tree *
- ucspi-tcp *
- unbound,restart_service:true *
- vbindiff *
- velero *
- viddy *
- wakeonlan *
- webp *
- wget *
- whatmask *
- wifi-password *
- wimlib *
- wireguard-tools *
- woff2 *
- xpdf *
- yamllint *
- yarn *
- ykman *
- ykpers *
- youtube-dl *
- yubico-piv-tool *
- zopfli *
- zsh *