The goal for this repo is to declaratively configure MacOS and Linux system using nixos/nix-darwin and home-manger.
feel free to take what you like.
Shell | zsh + starship |
WM | yabai + skhd + sketchybar |
Terminal | Alacritty + tmux |
Editor | Emacs + helix |
Browser | Firefox (shyfox) |
Shell | zsh + starship |
WM | xmonad + xmobar |
Terminal | Alacritty + tmux |
Editor | Emacs + helix |
Browser | Firefox (shyfox) |
https://github.com/stars/yuanw/lists/nix-home/
sudo xcode-select --install
mkdir workspaces
~cd workspaces && git clone https://github.com/yuanw/nix-home.git ~
with official script
sh <(curl -L https://nixos.org/nix/install)
or using
https://github.com/DeterminateSystems/nix-installer
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
On your Mac, choose Apple menu > System Settings, click General in the sidebar, then click Sharing. (You may need to scroll down.) Click Edit in the “Local hostname” section at the bottom of the window, then enter a new local hostname. If needed, turn on the “Use dynamic global hostname” option.
there are lots of GUI programs, we cannot install nicely using pure nix. There is brew-module in nix-darwin.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
What is benefits of this ?
we can install/uninstall applications using nix
don’t forget to do
brew analytics off
Please enable Full Disk Access for your terminal under System Settings → Privacy & Security → Full Disk Access.
gpg --list-secret-keys
or gpg --list-secret-keys user@example.com
pub 4096R/ABC12345 2020-01-01 [expires: 2025-12-31]
uid Your Name <user@example.com>
sub 4096R/DEF67890 2020-01-01 [expires: 2025-12-31]
ID of your key (second column e.g “ABC12345”)
gpg --export-secret-keys YOUR_ID_HERE > private.key
gpg --import private.key
.ssh/config
Host * IgnoreUnknown UseKeychain AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_ed25519
git-crypt unlock to load private files if needed
Make sure that the other web browser you want to use is already installed.
From the Apple menu in the corner of your screen, choose System Settings.
Click Desktop & Dock in the sidebar.
Scroll down on the right and choose a web browser from the “Default web browser” menu.
nix flake update --recreate-lock-file
nix build .#yuan-mac
./result/sw/bin/darwin-rebuild switch --flake .
darwin-rebuild --rollback
or
darwin-rebuild --list-generations
darwin-rebuild --switch-generation XX
$ nixos-rebuild switch --flake '.#' -user-remote-sudo
nix-diff /run/current-system ./result
sudo chown -R whoami:staff /nix/store