| 1 | # nix config |
| 2 | |
| 3 | this setup allows natalie, clover, and more to share common configuration |
| 4 | between their machines, but also share useful modules between each other. |
| 5 | |
| 6 | ``` |
| 7 | lib/ # reusable functions |
| 8 | modules/ # reusable modules |
| 9 | +-- home/ # home program configurations |
| 10 | +-- macos/ # nix-darwin configurations |
| 11 | +-- neovim/ # nvf configurations |
| 12 | +-- nixos/ # linux configurations |
| 13 | +-- shared/ # shared between nixos-rebuild & darwin-rebuild |
| 14 | users/ |
| 15 | +-- clover/ |
| 16 | | +-- user.nix # info about her |
| 17 | | +-- configuration.nix # for all hosts (system) |
| 18 | | +-- home.nix # for all hosts (userspace) |
| 19 | | +-- vim.nix # for neovim |
| 20 | | +-- sandwich/ |
| 21 | | | +-- configuration.nix # per host |
| 22 | | | +-- home.nix |
| 23 | | +-- paperback/ |
| 24 | | ... |
| 25 | +-- natalie/ |
| 26 | +-- user.nix # info about her |
| 27 | ... |
| 28 | ``` |
| 29 | |
| 30 | A new machine can be added by adding a new definition in `flake.nix`. Note that |
| 31 | the user and host `configuration.nix` and `home.nix` files are |
| 32 | |
| 33 | ## macOS installation instructions |
| 34 | |
| 35 | Install Nix using the upstream Nix (Pick "no" then "yes): |
| 36 | |
| 37 | ``` |
| 38 | curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \ |
| 39 | sh -s -- install |
| 40 | ``` |
| 41 | |
| 42 | While this installs, now is a good time to perform manual setup steps: |
| 43 | |
| 44 | - Setup your SSH keys in `~/.ssh` |
| 45 | - Configure the device hostname in System Settings in |
| 46 | - About -> Name |
| 47 | - General -> Sharing -> Local Hostname |
| 48 | - Make sure you're logged into iCloud / Mac App Store |
| 49 | - `xcode-select --install` to make sure Git and other utilities are available. |
| 50 | - Optional: Disable app verification with `sudo spctl --master-disable`, then, |
| 51 | go to System Settings -> Privacy to allow unsigned apps. |
| 52 | |
| 53 | Once Nix is installed, open a new shell and clone the repository: |
| 54 | |
| 55 | ``` |
| 56 | # Clone via HTTPs |
| 57 | git clone https://git.paperclover.net/clo/config.git |
| 58 | # With SSH Authentication |
| 59 | git clone git@git.paperclover.net:clo/config |
| 60 | ``` |
| 61 | |
| 62 | The location of the cloned repository must match what is in your `user.nix` |
| 63 | file. |
| 64 | |
| 65 | Setup `nix-darwin` using the `switch` helper: |
| 66 | |
| 67 | ``` |
| 68 | ./switch |
| 69 | ``` |
| 70 | |
| 71 | ## Neovim configuration |
| 72 | |
| 73 | By default, neovim is configured to all machines in `$PATH`. Neovim can be run |
| 74 | directly via `nix run`, which skips needing to build the whole system |
| 75 | configuration. |
| 76 | |
| 77 | ``` |
| 78 | nix run .#nvim-natalie # run by user |
| 79 | ./nvim # run based on your username |
| 80 | ``` |