Arke uses Lix, a robust and independent Nix implementation.
-
Install Lix
Follow the official instructions at lix.systems/install. -
Clone this repository
git clone https://github.com/rickpr/arke.git cd arke -
Configure Variables
Editvariables.nixto match your local system:{ user = "your_user"; fullName = "Your Name"; email = "your@email.com"; signingKey = "YOUR_GPG_KEY_ID"; macHostname = "your_hostname"; macSystem = "aarch64-darwin"; # or x86_64-darwin }
-
Build and Switch
Run the build script (requires sudo):chmod +x build_macos.sh ./build_macos.sh
Why use Nix/Lix instead of a standard Homebrew setup or a collection of Bash scripts?
| Feature | Arke (Nix/Lix) | Homebrew / Bash Scripts |
|---|---|---|
| State | Declarative: The code is the state. | Imperative: You hope the scripts ran correctly. |
| Reliability | Atomic: Builds either succeed or fail completely. | Fragile: Scripts can fail halfway, leaving a mess. |
| Reproducibility | Identical: Same config = same environment. | Drift: Versions drift over time across machines. |
| Rollbacks | Instant: Switch back to any previous generation. | Manual: Good luck undoing a broken script. |
| Isolation | Sandboxed: Packages don't bleed into each other. | Global: One update can break other dependencies. |
Arke splits dependency management between Nix (Lix) for CLI tools and development environments, and Homebrew for macOS-specific apps and casks.
Most of your terminal-based tools should go in home.nix.
- File:
home.nix - Key:
home.packages - Example:
home.packages = with pkgs; [ ripgrep fd ffmpeg # Add your new tools here ];
For things that are better managed via Brew (like GUI apps or specific Mac binaries), use darwin.nix.
- File:
darwin.nix - Keys:
homebrew.brews(CLI) andhomebrew.casks(GUI) - Example:
homebrew = { brews = [ "xcodegen" ]; casks = [ "ghostty" "postman" ]; };
flake.nix: The entry point, orchestrating outputs for macOS and Linux.variables.nix: Your centralized identity and hardware configuration.darwin.nix: macOS system-level settings and Homebrew integration.home.nix: Home Manager configuration (Git, Zsh, Bash, Emacs, Ghostty).common.nix: Shared packages across all platforms.
This setup includes Git Delta for beautiful, readable diffs and zdiff3 for smarter conflict resolution.
While this config aims to be comprehensive, you may need machine-specific tweaks:
- Shells: The config automatically sources
~/.zshrc_localfor Zsh or~/.bashrc_localfor Bash if they exist. - Identity: All personal identifiers is centralized in
variables.nix.
Home Manager will fail if it detects existing config files like .zshrc or .emacs.d.
- Solution: Before your first run, move existing config files to a backup (e.g.,
mv ~/.zshrc ~/.zshrc_local).
- Postgres: Managed as a service, but may need manual initialization or starting (
brew servicesorpg_ctl). - Ghostty Shaders: Included via Git submodule and symlinked automatically.
ἀρχή (Arke) means "first principle". This environment is built on:
- Reproducibility: Built from source and logic, not ad-hoc commands.
- Simplicity: Embracing "Worse is Better" for implementation simplicity.
- Sovereignty: Free from corporate lock-in, preferring Lix for a community-driven experience.
This project is released into the public domain via the Unlicense.
