Configuration files for MacOS and NixOS.
I recommend installing Nix using the Determinate Nix installer.
To run the installer:
$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
Open a new login shell and show nix version:
$ nix --version
nix (Nix) 2.18.1
To install Home manager you can use standalone home-manager on non-nixos system.
$ nix run home-manager/master -- init --switch
This will generate a flake.nix and a home.nix file in ~/.config/home/manager (creating the directory if it does not exist).
Run new shell with Git and OpenSSH installed (bundled version of OpenSSH with macOS Monterey doesn't support ed25519-sk keys):
$ nix shell nixpkgs#git nixpkgs#openssh
Clone dotfiles:
$ git clone git@github.com:wolffaxn/nixos-config.git ~/.nixos-config
Cloning into '/Users/alex/.nixos-config'...
Confirm user presence for key ED25519-SK SHA256:qnkGlZ1hUW3Ub7j3l440jE/8fA+z7hHzMc8U6RYKcfI
...
Run Home Manager:
$ cd ~/.nixos-config
$ home-manager build
$ home-manager switch --flake .#$(hostname)
On macOS you may also run nix-darwin:
$ nix build ./#darwinConfigurations.$(hostname).system
$ ./result/sw/bin/darwin-rebuild switch --flake .
This will update all input channels to the latest version. After that you need to run home-manager or nix-darwin to apply the changes.
$ nix flake update
$ home-manager switch --flake .#$(hostname)
$ nix flake update
$ nix build ./#darwinConfigurations.$(hostname).system
$ ./result/sw/bin/darwin-rebuild switch --flake .
Run garbage collector
$ nix store gc
Rerun nix-index
$ export NIX_PATH=nixpkgs=flake:nixpkgs
$ nix run github:nix-community/nix-index#nix-index
To run the uninstaller:
$ home-manager uninstall
To run the uninstaller:
$ /nix/nix-installer uninstall
After installing Nix I'm getting "SSL peer certificate or SSH remote key was not OK (60)" when I try to hit the cache. This fixes the problem: #3261
$ 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
This project is licensed under the terms of the MIT license.