config/readme.md

82 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2025-05-07 10:22:05 -07:00
# nix config
2025-05-12 15:19:01 -07:00
this setup allows natalie and chloe to share common configuration between their
machines, but also share useful modules between each other.
2025-05-07 10:22:05 -07:00
```
lib/ # reusable functions
modules/ # reusable modules
2025-05-12 15:32:01 -07:00
+-- home/ # home program configurations
2025-05-07 10:22:05 -07:00
+-- macos/ # nix-darwin configurations
2025-05-12 15:19:01 -07:00
+-- neovim/ # nvf configurations
2025-05-12 15:32:01 -07:00
+-- nixos/ # linux configurations
2025-05-07 10:22:05 -07:00
+-- shared/ # shared between nixos-rebuild & darwin-rebuild
users/
+-- chloe/
| +-- user.nix # info about her
2025-05-12 15:32:01 -07:00
| +-- configuration.nix # for all hosts (system)
| +-- home.nix # for all hosts (userspace)
2025-05-12 15:19:01 -07:00
| +-- vim.nix # for neovim
2025-05-07 10:22:05 -07:00
| +-- sandwich/
| | +-- configuration.nix # per host
| | +-- home.nix
| +-- paperback/
| ...
+-- natalie/
+-- user.nix # info about her
...
```
2025-05-12 15:19:01 -07:00
A new machine can be added by adding a new definition in `flake.nix`. Note that
the user and host `configuration.nix` and `home.nix` files are
2025-05-07 10:22:05 -07:00
## macOS installation instructions
Install Nix using the upstream Nix (Pick "no" then "yes):
```
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- install
```
While this installs, now is a good time to perform manual setup steps:
- Setup your SSH keys in `~/.ssh`
- Configure the device hostname in System Settings in
2025-05-12 15:19:01 -07:00
- About -> Name
- General -> Sharing -> Local Hostname
2025-05-07 10:22:05 -07:00
- Make sure you're logged into iCloud / Mac App Store
- `xcode-select --install` to make sure Git and other utilities are available.
2025-05-12 15:19:01 -07:00
- Optional: Disable app verification with `sudo spctl --master-disable`, then,
go to System Settings -> Privacy to allow unsigned apps.
2025-05-07 10:22:05 -07:00
Once Nix is installed, open a new shell and clone the repository:
```
# Clone via HTTPs
git clone https://git.paperclover.net/clo/config.git
# With SSH Authentication
git clone git@git.paperclover.net:clo/config
```
2025-05-12 15:19:01 -07:00
The location of the cloned repository must match what is in your `user.nix`
file.
2025-05-07 10:22:05 -07:00
Setup `nix-darwin` using the `switch` helper:
```
./switch
```
2025-05-12 15:32:01 -07:00
## Neovim configuration
By default, neovim is configured to all machines in `$PATH`. Neovim can be run
directly via `nix run`, which skips needing to build the whole system
configuration.
```
nix run .#nvim-natalie # run by user
./nvim # run based on your username
```