This repository contains my personal configuration files (dotfiles) for managing and customizing my system environment. The setup is built using the Nix package manager and is tailored for Darwin (macOS) systems.
Nix is a powerful, declarative, and reproducible package manager and build system. It provides a way to describe your system configuration in a single file, ensuring consistency and ease of setup across different machines. By using Nix, you can manage dependencies, configurations, and environments in a predictable and reproducible manner.
- Declarative Configuration: Easily define your entire system setup in a single file using Nix.
- Reproducibility: Ensure that your setup behaves consistently across different machines.
- Modularity: Organize configurations into reusable and composable components.
- Darwin (macOS) Support: Leverage Nix's capabilities to manage macOS-specific configurations.
To use these dotfiles, you'll need:
- Nix installed: Follow the installation guide for macOS.
- Flake Support Enabled: Ensure that Nix flakes are enabled in your Nix configuration. Add the following to your Nix configuration file (
~/.config/nix/nix.conf):experimental-features = nix-command flakes
Follow these steps to set up your Darwin system with the provided Nix configuration:
-
β¬οΈ Clone the Repository:
git clone https://github.com/<your-username>/<your-repo-name>.git cd <your-repo-name>
-
βοΈ Run the Flake to Configure the System: Use the following command to apply the configuration:
nix build .#darwinConfigurations.<hostname>.system ./result/sw/bin/darwin-rebuild switch --flake .#<hostname>
Replace
<hostname>with the hostname of your macOS system. You can find your hostname by runninghostnamein the terminal. -
π Rebuild Configuration (Optional): To rebuild and apply changes to the configuration, simply run:
darwin-rebuild switch --flake .#<hostname>
- flake.nix: The main entry point for the Nix configuration.
- packages/: Managment of programs that should be installed/configured.
- modules/: Reusable configuration modules.
- home.nix: User-specific configurations managed via the Home Manager module.
- Flake Support Not Enabled: Ensure you have added
experimental-features = nix-command flakesto your Nix configuration file. - Build Errors: Review the output logs for any dependency or syntax issues.
- Hostname Mismatch: Make sure to replace
<hostname>with the correct hostname of your system.
With this repository, you can easily manage and maintain a reproducible and highly customizable macOS environment. Feel free to fork and adapt it to suit your personal needs!