Shared ModulesΒΆ
Much of the code running on both macOS and Linux (NixOS) is found here.
LayoutΒΆ
.
βββ config # Config files not written in Nix
βΒ Β βββ emacs/ # Emacs configuration
βΒ Β βββ vscode/ # VSCode configuration
βΒ Β βββ gcp-ssh-script.sh # WezTerm configuration
βΒ Β βββ starship.toml # Starship configuration
βΒ Β βββ wezterm.lua # WezTerm configuration
βββ cachix # Defines Cachix, a global cache for builds
βββ files.nix # Non-Nix, static configuration files (immutable by default, option for mutable)
βββ mutable.nix # Adds options to home.file to make files mutable
βββ packages.nix # List of shared packages
βββ programs.nix # Main shared configuration for most programs
DetailsΒΆ
UtilitiesΒΆ
cachix
defines substituters, which are additional stores from which Nix can obtain objects rather than building them from source. This enables faster builds, and you typically wonβt need to modify this file. For more documentation, refer to the Nix Reference Manual.mutable.nix
is adapted from this gist. It adds two flags tohome.file = { }
:mutable = true;
β allows the created or symlinked file to be modified.force = true;
β required ifmutable = true;
.An example of its usage can be found in
modules/darwin/files.nix
to define VSCode keybindings and settings, which must be mutable since VSCode will override them when new keybindings are defined. See config/vscode for more details.
Core ConfigurationΒΆ
This structure is very similar to the modules/darwin
config and the modules/linux
config. Here, you define any files, packages, and program settings that should be shared between your Linux and Darwin configurations. In fact, most of your shared configuration will reside here.
In
files.nix
, specify files that should be pre-created or symlinked. By default, files are immutable to guarantee reproducibility, but if you require some files to be mutable (such as VSCode keybindings), this is possible thanks tomutable.nix
.In
packages.nix
, define any packages you may need across systems.In
programs.nix
, define settings specific to the programs you use. Examples include configuration forgit
,zsh
, orvim
.Any specific options for
programs
are handled throughhome-manager
. You can find available options in the Home Manager Option Search
External configurationΒΆ
Additional configuration for some programs can be found in config/ directory.