This is my system configuration. It’s a continual work in progress. It also relies upon less public configuration in another repository. My end goal is to transform this into a fully literate configuration. At least as much as is reasonable. At some point I need to bootstrap the configuration, of course.
Some configuration here is private and cannot reasonably shared with the
community at large. These exist as separate repositories whose permissions are
locked down to my personal access only. Some paths in here will refer to private
repositories or files. All of them will have a private
identifier somewhere in
the name. It is recommended that you stub these out if you’re not me, but if
you’re in a rush you can just comment/remove these references to get you going.
You will want to backup your ~/.zshrc
and perhaps other shell configuration
files.
Run ./install.sh
.
Other installers are named install-<thing>.sh
or <thing>-install.sh
, with
the latter being preferred but refactoring is not done yet. In addition,
installers are slowly being removed in favor of Nix. See the Nix section for
details on its preferred layout.
This repository uses Nix extensively. Nix is used in conjunction with home-manager to manage a user’s configuration. nix-darwin is used for macOS configurations. Everything locked via Nix Flakes. The entry point is ./nix/flake.nix.
Nix installation can be run by itself via ./nix-install.sh
.
I have in-progress work and notes in ./nix/README.org.
This is done via:
nix-channel --update
Use this to apply changes on macOS:
nix-darwin-switch
This wraps the normal invocation.
Home Manager manages the configuration of a user.
Warning: Do not use the invocations below. Home manager is in use but delegated
to by nix-darwin
or NixOS.
Normally you would use this to build a home-manager configuration:
home-manager build
To use the new configuration, use
home-manager switch
switch
implies build
.
home.nix
is the starting point for home-manager
, and is required to be named
that via home-manager
_when home-manager
is the only entity in control.
This does not apply when using nix-darwin
or NixOS.
Generally we want to avoid global tool installs for various things (like what version of Node.js you’re running), and instead push those to specific repositories.
Old - needs updating since we now use flake.nix
instead of shell.nix
but
much of this still applies.
This installation includes direnv
, which can automatically load a shell.nix
file when entering its directory if the path has been blessed via direnv
allow
. The shell.nix
file declares a series of packages which will be
available in the shell, and possibly even additional setup (like adding shell
aliases or running some initial setup like database schemas). This is like tools
like pyenv
, rbenv
, and nodenv
or the *vm
equivalents (rvm
, nvm
,
etc), but it works for any software that Nix can handle, not just that one
ecosystem.
Use nix-direnv-add-envrc
to lay down the necessary direnv
files and also
allow
the setup immediately.
Some languages that require runtimes (Ruby, Python, Node.js) all have packages
that can be installed globally and communities tend to author tools which
leverage this. Installing these kinds of packages by hand is not really the Nix
way and generally you will run into permissions errors trying to do this with
this configuration. Instead you want to install these packages via your .nix
files.