Skip to content

mattbun/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

It's Matt's dotfiles!

Starring configurations for...

It's Nix!

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.

Why do all of the nix commands use --impure?

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.

Getting Started

Clone this repo

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

Check out .config/nixpkgs/system.nix

.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.

Installation

NixOS

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.

  1. 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"
  2. From here on, to apply configuration changes run

    make

Arch Linux

  1. Install nix

    sudo pacman -S nix
  2. Enable nix-daemon

    sudo systemctl enable nix-daemon
  3. Add user to nix-users group

    sudo gpasswd -a matt nix-users
  4. Log out and back in again for the group change to take effect.

  5. 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"
  6. From here on, to apply configuration changes run

    make

Mac

  1. Install homebrew

  2. Install nix

  3. 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"
    
  4. 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.