Using nix to provisioning devices on Mac OSX (M-series chip). Inspect apps.json
for the default set of apps / packages will be installed.
System packages also installed.
-
fish Fish shell
-
zsh
-
MacOS Only:
- Fonts:
hack-font
,fira-code
,open-sans
,source-code-pro
,jetbrains-mono
withnerd-fonts
overlay - Kitty terminal with Catpucinn-Mocha theme
- Fonts:
Following are extra that will be added on to current-user scope:
As mentioned, fish and zsh shells are available (asides from system provided shells).
-
Fish shell extensions:
hydro theme
grc
colored-man-pages
foreign-env
sponge
forgit
pisces
puffer
humantime-fish
done
bass
-
Zsh shell extensions are (managed via
zimfw
)
- Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install nix (as multi-user) nix-installer
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
- Clone this repo to
~/.setup
Notes:
-
If
/etc/nix/nix.conf
already existed, move it to~/.config/nix/nix.conf
-
If
/etc/shells
or similar files already existed, back up and remove -
If running into error
...ln: failed to create symbolic link '/run': Read-only file system
sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t
-
if running to warning
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
sudo cp -R /nix/var/nix/profiles/per-user/<username>/channels /nix/var/nix/profiles/per-user/root/
-
Setup a public/private repo
github:<username>/dotnix-config
(see Example). -
Clone to current setup as
config
. Checkout to the branch pertinent to the host. -
On WSL, ensure
~/.config/nix/nix.conf
is available with content# nix/nix.conf experimental-features = nix-command flakes
-
Commit
nix build .#darwinConfigurations.<hostname>.system
./result/sw/bin/darwin-rebuild switch --flake .#<hostname>
Note: After initial setup, darwin-rebuild
should be in PATH
darwin-rebuild switch --flake .
nix build ".#homeConfigurations.<hostname>.activationPackage" # product a result folder
./result/activate
-
Only brews / casks that specified in
./config/apps.json
will be installed. Non specified will be removed -
Mas refers to
Mac App Store
apps will be installed as extra. Existing Mas id can located via mas-cli -
Trusted uses will be current user plus all specified in
system.json
. Default:[<username>]
-
Allowed users will be current user plus all specified in config. Default:
[*]
-
By default, git will required GPG setup to sign commits.
include
andincludeIf
are available for multiple git profiles. Seegit.example
for details. Remove if not required. -
On MacOSX, reset current-user shell to
# fish chsh -s /run/current-system/sw/bin/fish # zsh chsh -s /run/current-system/sw/bin/fish
-
On WSL, it's expected to install 1P-cli in WSL under path
/usr/bin/