Note
Mac only for now. I haven't tested this config on NixOS yet.
Install dependencies:
xcode-select --install
Next, install Nix using The Determinate Nix Installer.
Then clone this repository, cd
into the directory, and run the following
command to build and apply changes:
nix run .#build-switch
Fish needs to be manually set as the login shell:
echo ~/.nix-profile/bin/fish | sudo tee -a /etc/shells
chsh -s ~/.nix-profile/bin/fish
See:
I use Berkely Mono, which must be manually installed.
I use Homebrew for a few dependencies on Mac. (Homebrew must be manually installed, as per the official installation instructions.)
Note that the template that this config is built off of uses nix-homebrew to manage the Homebrew installation. I've removed that from here (at least for now) as I don't think it's worth the extra complexity (especially since Nix is dramatically reducing my reliance on Homebrew). I'm not using nix-darwin's Homebrew-related features either; I'll just manage Homebrew separately for the time being.
Emacs is installed via Nix, but my configuration is not part of this repository (and not managed by home-manager).
To grab my config:
git clone https://github.com/mjrusso/.emacs.d ~/.emacs.d
Notes:
- consider automating symlinking for .emacs.d (perhaps merge my existing emacs repo into this one?)
- https://www.reddit.com/r/NixOS/comments/197wnuy/help_making_a_direct_symlink_from_config_repo_to/
- https://github.com/kenranunderscore/dotfiles/blob/310fb5694934010dbee577f5659a45a3144d3626/home-manager-modules/emacs/default.nix#L11-L17
- https://discourse.nixos.org/t/how-to-manage-dotfiles-with-home-manager/30576
- alternatively can I set it up this way? https://www.reddit.com/r/NixOS/comments/vj95cd/home_manager_and_separate_dotfiles_repo/
(These commands must be executed from the directory that this repo has been cloned to.)
To build and apply changes:
nix run .#build-switch
Note
Only files in the working tree will be copied to the Nix
Store. Ensure that any new files
have been added to the working tree (use git add
) before running
nix run .#build
or nix run .#build-switch
, or they will be ignored. (The
files do not need to be committed to the repo.)
To update dependencies:
nix flake update
- https://github.com/dustinlyons/nixos-config
- https://github.com/mitchellh/nixos-config
- https://determinate.systems/posts/nix-direnv/
- https://mitchellh.com/writing/nix-with-dockerfiles
Thanks to Dustin Lyons's starter template, which this configuration is based off of.