The configuration in this repo relies on Nix and Home Manager. That doesn't mean it only works on NixOS! I've also used it in macOS (with nix-darwin), Arch Linux, and ChromeOS's Crostini.
So I don't have to hard-code the system architecture, username, or home directory. The nix configurations in this repo rely on builtins.currentSystem
and builtins.getEnv
which don't work in pure evaluations with flakes.
Nix and Home Manager should be able to handle this repo being cloned anywhere, but I usually clone it to my home directory with:
cd
git init
git remote add origin [email protected]:mattbun/dotfiles.git
git fetch
git checkout main
.config/nixpkgs/system.nix
is where system-specific configuration lives. Use it to set an accent color, enable/disable applications, or override configurations from other modules in this repo.
It's possible to use Home Manager's NixOS module to hook this into the system config, but I like to keep them separate for simplicity's sake.
-
Install and set up home-manager
# If make is already installed make install # Or you can use the configuration in shell.nix to create an ephemeral shell with 'make' in it nix-shell --command "make install"
-
From here on, to apply configuration changes run
make
-
Install nix
sudo pacman -S nix
-
Enable nix-daemon
sudo systemctl enable nix-daemon
-
Add user to nix-users group
sudo gpasswd -a matt nix-users
-
Log out and back in again for the group change to take effect.
-
Install home-manager and get everything set up
# If make is installed make install # Or you can use the configuration in shell.nix to create an ephemeral shell with 'make' in it nix-shell --command "make install"
-
From here on, to apply configuration changes run
make
-
Install dependencies and get everything set up
# If make is installed make install # Or you can use the configuration in shell.nix to create an ephemeral shell with 'make' in it nix-shell --command "make install"
-
From here on, to apply configuration changes run
make
Note: some of the system.defaults
options in darwin.nix
require a Finder or Dock restart to take effect.