Note
Mac and Linux (non-NixOS) only for now. I haven't tested 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
Set Fish as the login shell:
echo ~/.nix-profile/bin/fish | sudo tee -a /etc/shells
chsh -s ~/.nix-profile/bin/fish
Next, install Homebrew. (Homebrew must be manually installed, as per the official installation instructions.) To reduce the number of moving parts, I'm not using nix-homebrew, or nix-darwin's Homebrew-related features.
Install Nix, and then perform a standalone installation of home-manager:
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
nix-shell '<home-manager>' -A install
Then clone this repository, cd
into the directory, and run the following
command to build and apply changes:
nix run .#build-switch
And set Fish as the login shell:
echo ~/.nix-profile/bin/fish | sudo tee -a /etc/shells
sudo /sbin/usermod -s ~/.nix-profile/bin/fish $USER
Finally, reboot the system. (Rebooting is required for terminal definitions to
be properly installed; see $TERMINFO_DIRS
.)
I use Berkeley Mono, which must be manually installed.
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 (without applying changes):
nix run .#build
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.