Add support for darwin

This commit is contained in:
Dave Gallant
2021-05-30 08:33:09 -04:00
parent 0a91e46af6
commit 8498968acc
10 changed files with 195 additions and 149 deletions

View File

@@ -2,24 +2,34 @@
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
This repo stores nix to manage my machines running [NixOS](https://nixos.org/). The initial structure was inspired by [samuelgrf/nixos-config](https://gitlab.com/samuelgrf/nixos-config/-/tree/master/).
This repo stores nix to manage my machines running both [NixOS](https://nixos.org/) and macOS. The initial structure was inspired by [samuelgrf/nixos-config](https://gitlab.com/samuelgrf/nixos-config/-/tree/master/).
The configuration is very specific to my own machines and setup, but it may be a useful reference for anyone else learning or experimenting with nix, whether it be on a desktop or a server.
## Setup
```console
$ git clone git@github.com:davegallant/nix-config.git
$ cd nix-config
$ sudo ./rebuild.sh switch
### NixOS
```sh
sudo ./rebuild.sh switch
```
### macOS
1. Install the latest unstable nix from https://github.com/numtide/nix-unstable-installer (to get nix flakes)
1. Install nix-darwin: https://github.com/LnL7/nix-darwin
1. Add home-manager channel: `nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager; nix-channel --update` (TODO: this requirement should be removed in the future)
```sh
./rebuild.sh switch
```
## Update
To update nixpkgs defined in [flake.nix](./flake.nix), run:
```console
$ nix flake update
```sh
nix flake update
```
If there are updates, they should be reflected in [flake.lock](./flake.lock).