apps | ||
flake-parts | ||
home-manager/modules | ||
nixos | ||
packages | ||
.envrc | ||
.gitignore | ||
flake.lock | ||
flake.nix | ||
LICENSE | ||
README.org |
dotfiles.nix
My dotfiles using Nix. System configuration done using nix-darwin and NixOS. User configuration using home-manager. This repo is put together as a flake using flake-parts.
Much of the structure of dotfiles.nix is taken from terlar/nix-config with other ideas taken from ~rycee/configurations. Another notable info source is hlissner/dotfiles.
All Nix code in this repo is formatted using alejandra.
Usage
Show what this flake provides:
nix flake show
Switch both system (NixOS) and home:
nix run .#nixos-switch
Switch both system (nix-darwin) and home:
nix run .#darwin-switch
Switch home only:
nix run .#home-switch
Build home without switching:
nix run .#home-switch
Update all inputs:
nix flake update --commit-lock-file
Update a single input:
nix flake lock --update-input nixpkgs --commit-lock-file
Format all nix files:
nix fmt
Enter the dev shell (if not using nix-direnv):
nix develop
Outputs
Home Configurations
Due to the way the homeConfigurations
output is structured (each user configuration is generated for each system,) the home-manager switch --flake
command cannot be used as per usual, instead the FLAKE_CONFIG_URI
variable needs to be set. See /willemml/dotfiles.nix/src/commit/12439146d520e2d96c737c61a094049c92272f03/apps/home-switch.nix for an example.
All home configurations are exposed under both packages.SYSTEM.home-USER
and homeConfiguration.SYSTEM.USER
.
Apps
These packages make some operations simpler or more intuitive, to use an app, run the following command from within the flake directory: nix run .#APPNAME
.
darwin-switch
Build and switch to the nix-darwin configuration for the current host (only on Darwin.)
The configuration is defined under darwinConfigurations.HOSTNAME
.
nixos-switch
Build and switch to the nixos configuration for the current host (only on NixOS.)
The configurations are defined under nixosConfigurations.HOSTNAME
.
home-switch & home-build
Build and or switch to the home-manager configuration for the current user.
Home configurations are defined under homeConfigurations.SYSTEM.USER
.
Packages
This flake exposes several package definitions I have created, most of them are binary sourced applications for macOS, most importantly Firefox.
Darwin Configurations
System configurations for macOS.
zeus
My primary computer.
NixOS Configurations
System configurations for NixOS.
zeusvm
Linux VM for my macOS machine (darwinConfigurations.zeus
).
zeusasahi
NixOS configuration for my M1 MacBook Pro, uses tpwrules/nixos-apple-silicon. Currently untested, WIP.
NixOS Modules
Modules for NixOS configurations, most of these should also work for Darwin.
custom-linkNixInputs
Adds the inputs of this flake to the nix registry and NIX_PATH
.
Taken from LnL7/nix-darwin #277.