Comprehensive macOS configurations managed and expressed with Nix. This repository also includes a streamlined installation script for setting up Homebrew, Nix, and system configurations.
- Automated setup for Homebrew, Nix, and essential configurations.
- Modular macOS configurations for developers.
- Built-in development shell management.
Before running the installation script, ensure the following are installed on your system:
- Xcode Command Line Tools: Install via:
xcode-select --install
- Git: Verify with
git --version
and install via Xcode if not available.
The install.sh
script automates the setup process, including:
- Installing Homebrew (if not already installed).
- Installing Nix with specific configurations and experimental features.
- Setting the system hostname.
- Installing Rosetta (if applicable).
- Preparing essential directories and linking configurations.
-
Clone the repository:
git clone https://github.com/<your-username>/dot-files.git cd dot-files
-
Run the install script:
export HOSTNAME=your-hostname ./install.sh
If you don’t provide a hostname, it defaults to
buque
. -
Reboot your machine.
-
Complete the following post-installation tasks:
- Configure the keyboard layout to British PC.
- Enable
FN
+ESC
functionality to toggle the escape key. - Import your GPG keys:
gpg --import secrets/g.key
- Log into your password manager and configure any required keys:
git-crypt unlock <decoded-key>
The install.sh
script performs the following actions:
-
Install Homebrew (if not already installed):
- Installs using the official Homebrew installation script.
-
Install Nix (if not already installed):
- Installs version
2.25.3
with the following experimental features enabled:nix-command
flakes
repl-flake
- Installs version
-
Set System Hostname:
- Configures the system hostname, local hostname, and computer name using the
HOSTNAME
environment variable.
- Configures the system hostname, local hostname, and computer name using the
-
Rosetta Installation:
- Installs Rosetta for compatibility with x86 applications.
-
Directory Setup:
- Creates essential directories like
.config/kitty
,.config/peco
, and.ssh
.
- Creates essential directories like
-
Nix Configuration:
- Links the custom Nix configuration file to
/etc/nix/nix.conf
.
- Links the custom Nix configuration file to
-
Rebuild System:
- Builds and switches the macOS configuration using
darwin-rebuild
.
- Builds and switches the macOS configuration using
You can easily access remote development shells defined in this flake. Here's how:
-
Add a remote shell to your
.envrc
:echo "use flake github:gilacost/dot-files#elixir_1_18_1_erlang_27_2" > .envrc
-
Allow
direnv
to load the environment:direnv allow
Now, your shell environment will automatically load the specified development shell whenever you enter the directory.
The repository supports multiple development shells defined in dev_shells/default.nix
. To list available shells dynamically:
-
Run the following command to show all available shells:
nix flake show ./#devShells
-
Load a specific shell with:
nix develop ./#<shell-name>
For example:
nix develop ./#elixir_1_18_1_erlang_27_2
Replace
<shell-name>
with any valid shell listed in the output ofnix flake show
.
- Configure right-click functionality on the Magic Mouse.
- Configure any custom
.zshrc_local
settings as needed. - Install Tree-sitter modules in Neovim:
nvim :TSInstall all
- gh auth login --web -h github.com
- first time gh copilot alias -- zsh
- review gh in dot-files
This repository is licensed under the MIT License.