These are my personal dotfiles and NixOS/home-manager configurations for setting everything up. I doubt anyone would even want to use this directly, but feel free to use it for your own inspiration (or apply any workarounds for issues I've hit...).
I've tried to organize things in a logical way, so for the time being, things are structured as follows:
config
: contents which might represent the~/.config
directory. Basically "literal" configs and definitions which get linked/incorporated through home-managerdocs
: additional documentation files, mostly for myself, but may be useful to othershomeConfigurations
: top-level fully instantiated home-manager configurations. Useful for having the CI cache the artifacts and make sure that everything builds. Also includes amodule
attribute which allows for importing/overriding the definition as needed.homeManagerModules
: a collection of "common" home-manager modules which could be used in other dependent flakes. They're definitely tailored to my own preferences though, and lack robust options (like how home-manager might lay things out)!lib
: collection of helper functions for doing things like crawling directories and automatically making flake outputs of thingsnixosConfigurations
: top level system configurations, named by machine/host namenixosModules
: same ashomeManagerModules
but related to system configuration modulespkgs
: my own package definitions which aren't available upstreamusers
: common user definitions that can be reused across system configurations. Normally this directory would have adefault.nix
module which defines user groups, home directories, etc., and ahome.nix
module which contains the root of the home-manager configurations for this user.
- Machine initialization - How to prepare a machine for NixOS installation
Applying configuration changes on a local machine can be done as follows:
cd ~/dotfiles
sudo nixos-rebuild switch --flake .
# This will automatically pick the configuration name based on the hostname
Applying configuration changes to a remote machine can be done as follows:
cd ~/dotfiles
nixos-rebuild switch --flake .#nameOfMachine --target-host machineToSshInto --use-remote-sudo