|
||
---|---|---|
hosts | ||
lib | ||
modules | ||
nix | ||
pkgs | ||
secrets | ||
users | ||
.envrc | ||
.gitignore | ||
.luacheckrc | ||
flake.lock | ||
flake.nix | ||
hosts.toml | ||
README.md | ||
statix.toml |
Meine wundervolle nix config
Structure
hosts/
contain nixos configuration for hosts<hostname>/
configuration for hostsdefault.nix
Toplevel system definitionfs.nix
file system definitonnet.nix
network setupsecrets/
secrets local to this hostssecrets.nix.age
local secrets usable on deployhost.pub
host public key, needed for rekeying agenix secrets
modules/
extra nixos modules and shared configurationssecrets.nix
module to enable deploy-time secretsconfig/
base configuration used on all machinesdev/
configuration options enabling developer environmentgraphical/
configuration for graphical environmentshardware/
configuration for hardware componentsimpermanence/
impermanence modules for hosts
nix/
additional nix functionschecks.nix
pre-commit checkscolmena.nix
Setup for using colmena to deploydevshell.nix
Development shellextra-builtins.nix
Extra builtin plugin file to enable repository secretsgenerate-node.nix
logic to generate nodes for colmenalib.nix
additional library functions
secrets/
global secrets<name>.key.pub
public key handles to decrypt secrets using yubikeyrecipients.txt
rage recipient file for encrypting secrets- currently containing both yubikeys and a rage backup key
secrets.nix.age
global secrets available at deploy
users/
home manager user configurationcommon/
shared home-manager modulesgraphical/
configuration for graphical programsprograms/
configuration for miscellaneous programsshells/
configuration for shellsdefault.nix
minimal setup for all usersinteractive.nix
minimal setup for interactive users on a command linegraphical.nix
configuration for users utilizing a graphical interface
<username>/
configuration for usersimpermanence.nix
users persistence configuration
Hosts
patricknix
my main laptopdesktopnix
my main desktoptestienix
old laptop for testing
Users
patrick
my normal everyday unprivileged userroot
root user imported by every host
Flake output structure
apps
executables used for editing this configurationedit-secret
edit an age encrypted secretrekey
rekey all secret files for the host's secret key, enabling agenixrekey-save-output
only internal use
checks
linting and other checks for this repositorypre-commit-check
automatic checks executed as pre-commit hooks
colmena
outputs used by colmenacolmenaNodes
per node configurationnodes
alias tocolmenaNodes
devshell
development shell using devshellformatter
nix code formatterhosts
host meta declarationpkgs
nixpkgspackages
additional packagessecretsConfig
meta configuration for secretsstateVersion
global stateversion used by nixos and home-manager to determine default config
How-To
Add additional hosts
- Add host definition to
hosts.toml
- Create host configuration in
hosts/<name>
- Create and fill
default.nix
- Fill
net.nix
- Fill
fs.nix
- Don't forget to add necesarry config for filesystems, etc.
- Create and fill
- Generate ISO image with
nix build --print-out-paths --no-link .#images.<target-system>.live-iso
- This might take multiple minutes(~10)
- Alternatively boot an official nixos image connect with password
- Copy ISO to usb using dd
- After booting copy the installer to the live system using
nix copy --to <target> .#packages.<target-system>.installer-package.<target>
- Run the installer script from the nix store of the live system
- you can get the path using
nix path-info .#packages.<target-system>.installer-package.<target>
- you can get the path using
- Export all zpools and reboot into system
- Retrieve hostkeys using `ssh-keyscan | grep -o 'ssh-ed25519.*' > host//secrets/host.pub
- Deploy system using colmena
Deploy
colmena apply --on <hostname>
If deploying from a host not containing the necessary nix configuration option append
--nix-option plugin-files "$NIX_PLUGINS"/lib/nix/plugins --nix-option extra-builtins-file ./nix/extra-builtins`