···11112. Clone this repo to `~/.dot`.
12123. Apply the configuration for the current host.
13131414+Automatic upgrades use a separate deploy clone at `~/.dot-deploy` by default.
1515+That clone is bootstrapped from the `origin` remote of `~/.dot` the first time
1616+the scheduled macOS upgrade job runs, then updated independently from its own
1717+`origin/main` afterward.
1818+1419macOS:
15201621```sh
···44492. Add an entry to `hosts.nix` using that hostname as the attribute name.
45503. Set `system` to the target platform string, for example `aarch64-darwin`, `x86_64-linux`, or `aarch64-linux`.
46514. Set `username` to the local account that Home Manager should manage.
4747-5. Override `homeDirectory` or `flakeDirectory` only when the machine uses a non-standard path.
5252+5. Override `homeDirectory`, `flakeDirectory`, or `deployDirectory` only when the machine uses a non-standard path.
48534954You can get the `system` value on the target machine with:
5055···5560## Repository Layout
56615762```text
6363+.github/workflows/ # remote lock-file maintenance on GitHub
5864darwin/ # nix-darwin system-level modules for macOS
5965 default.nix # main macOS settings, users, Homebrew
6060- auto-upgrade.nix # scheduled darwin-rebuild and Nix garbage collection
6666+ auto-upgrade.nix # sync deploy clone, run darwin-rebuild, and garbage collect
6167home/ # Home Manager user-level modules shared across platforms
6268 default.nix # shared user configuration entry point
6369 packages/
···72787379- `flake.nix` exports Darwin hosts as `darwinConfigurations` and non-Darwin hosts as `homeConfigurations`.
7480- On macOS, Home Manager is embedded inside `nix-darwin`, so user configuration still lives under `home/`.
8181+- Daily macOS upgrades rebuild from `~/.dot-deploy`, keeping `~/.dot` free for branch work and local edits.
8282+- The deploy clone is updated with `git pull --ff-only origin main` before each scheduled rebuild.
8383+- A scheduled GitHub Actions workflow opens a PR that refreshes `flake.lock` for `nixpkgs` and `neovim-nightly-overlay`.
7584- Automatic upgrade logs live at `/var/log/darwin-auto-upgrade.log`.
7685- The automatic `darwin-rebuild` job runs daily at 02:00.
7786- Nix garbage collection runs weekly on Sunday at 03:15 and deletes generations older than 30 days.
···2727 isDarwin = host: lib.hasSuffix "darwin" host.system;
28282929 # Fill in default paths so every host entry has the same shape, even when
3030- # `homeDirectory` or `flakeDirectory` are omitted in `hosts.nix`.
3030+ # `homeDirectory`, `flakeDirectory`, or `deployDirectory` are omitted in
3131+ # `hosts.nix`.
3132 # {
3233 # system
3334 # username
3435 # homeDirectory
3536 # flakeDirectory
3737+ # deployDirectory
3638 # }
3739 mkHost = host:
3840 let
···4648 host // {
4749 inherit homeDirectory;
4850 flakeDirectory = host.flakeDirectory or "${homeDirectory}/.dot";
5151+ deployDirectory = host.deployDirectory or "${homeDirectory}/.dot-deploy";
4952 };
50535154 # Load the host inventory and normalize each entry once up front.
···9598 # Values passed here:
9699 # self - the flake's own output set
97100 # hostName - the attribute name from `darwinConfigurations`
9898- # flakeDirectory - absolute path where the flake lives on disk
101101+ # flakeDirectory - interactive working checkout on disk
102102+ # deployDirectory - dedicated checkout that tracks `origin/main`
99103 # username - primary user account name
100104 # homeDirectory - absolute path to the user's home directory
101105 specialArgs = {
102106 inherit self hostName;
103103- inherit (host) flakeDirectory username homeDirectory;
107107+ inherit (host) flakeDirectory deployDirectory username homeDirectory;
104108 };
105109106110 modules = [
+1
hosts.nix
···1212 # Optional overrides:
1313 # - `homeDirectory`: defaults to `/Users/<username>` on macOS and `/home/<username>` on Linux
1414 # - `flakeDirectory`: defaults to `<homeDirectory>/.dot`
1515+ # - `deployDirectory`: defaults to `<homeDirectory>/.dot-deploy`
1516 MacBook-Air-de-Daniel = {
1617 system = "aarch64-darwin";
1718 username = "vieitesprefapp";