This is my ever-evolving dotfiles repository, used to manage my desktop workstation, a MacBook Pro, and any Linux devbox capable of running Nix. This repository is constantly improved or changed in some way. It follows a structure to keep related configurations together, but not too much to reduce complexity.
nix develop
# NixOS rebuilds (hostname autodetection)
nh os switch .
# HomeManager rebuilds (hostname & username autodetection)
nh home switch .
# NixOs build with custom hostname
nh os build --hostname k3s-m0 .
# HomeManager build with custom hostname
nh home switch -c macbook
# NixOS build installer iso image
nix build .#nixosConfigurations.iso.config.system.build.isoImage
💽 Disko
Disko is used to provision disks, it creates automatically the filsystems
configuration.
# Run disko from an installer
sudo nix run github:nix-community/disko --no-write-lock-file -- --mode zap_create_mount ./hosts/zion/disko.nix
# After this nixos can be installed
sudo nixos-install --flake .#zion
flake.nix
Entrypoint to all:NixOS
configurations.HomeManager
configurations.devShells
to providenix develop
environment. (seeshell.nix
)formatter
.
shell.nix
Shell config fornix develop
environment.- Leverage git-commit-hooks with enforce of lint, fmt & code checking.
- Shell environment with all tools needed to switch, build & run the
flake
.
hosts/
All physical machines managed byNixOS
.nixos
Modules forNixOS
separated into:common/
default configurations for allhosts
.*
optional to import.
home-manager
Entrypoint for allhome-configurations
perhost
.common/
contains configuration defaults valid for allhome-configurations
.*/
containsNixOS
modules, optional to import.
isos/
Configuration for allNixOS
configurations which build images.static/
Static files mostly not used for nix.nix.nix
Nix & nixpkgs configuration forNixOS
&HomeManager
.
Host
:- ⚖️ Every
hosts
entrypoint is adefault.nix
.- ⚖️ It imports all
NixOS
modules aspath
. - ⚖️ Define host specific configuration
- ⚖️ Imports
hardware-configuration.nix
- ⚖️ It imports all
- May has a
disko.nix
configuration to configurefilsystems
.
- ⚖️ Every
home-manager
- ⚖️ Every
host
has its own entrypoint at toplevel. - ⚖️ Every
host
entrypoint is a file with the host name which:- Imports all
Home
configuration for thishost
. - Defines host specific configuration
- Imports all
- ⚖️ Every