No description
reo101
7cf980d913
Redefine `createPackages` and `createModules` in terms of `createThings` Move `lib` flake module to a subdirectory |
||
---|---|---|
.github/workflows | ||
apps | ||
hosts | ||
modules | ||
nix | ||
overlays | ||
pkgs | ||
secrets | ||
shells | ||
templates | ||
.envrc | ||
.gitignore | ||
default.nix | ||
flake.lock | ||
flake.nix | ||
LICENSE | ||
nixpkgs.nix | ||
README.md | ||
shell.nix |
Structure
- Everything is built upon flake-parts, with flake modules for automatic packages, modules && configurations extraction
- Automatic classic (
callPackage
) anddream2nix
packages extraction - Automatic
nixos
,nix-darwin
,nix-on-droid
,home-manager
andflake
modules extraction - Automatic
nixos
,nix-darwin
,nix-on-droid
andhome-manager
configurations extraction
- Automatic classic (
- Hosts can be found under
./hosts/${config-type}/${system}/${hostname}/...
- Check
./modules/flake/configurations.nix
for more info on what is extracted from those directories
- Check
- Modules can be found under
./modules/${config-type}/...
- Check
./modules/flake/modules.nix
for more info on what is extracted from that directory
- Check
- Packages can be found under
./pkgs/...
- Overlays can be found under
./overlays/...
- Shells can be found under
./shells/...
- Default one puts a recent
nix
together with some other useful tools for working with the repo (deploy-rs
,rage
,agenix-rekey
, etc.), see./shells/default/default.nix
for more info
- Default one puts a recent
Topology
You can see the overall topology of the hosts by running
nix build .#topology
And opening the resulting ./result/main.svg
and ./result/network.svg
Secrets
Secrets are managed by agenix
and agenix-rekey
Note
Secrets are defined by the hosts themselves,
agenix-rekey
just collects what secrets are referenced by them and lets you generate, edit and rekey them
# To put `rage`, `agenix-rekey` and friends in `$PATH`
nix develop
Edit secret
# Select from `fzf` menu
agenix edit
Rekey all secrets
agenix rekey
Generate missing keys (with the defined generators
)
agenix generate
Setups
NixOS setup
# Initial setup
nix run nixpkgs#nixos-anywhere -- --flake ".#${HOSTNAME}" --build-on-remote --ssh-port 22 "root@${HOSTNAME}" --no-reboot
# Deploy
deploy ".#${HOSTNAME}" --skip-checks
MacOS / Darwin (silicon) setup
# Setup system tools
softwareupdate --install-rosetta --agree-to-license
sudo xcodebuild -license
# Install nix
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Apply configuration
git clone https://www.github.com/reo101/rix101 ~/.config/rix101
cd ~/.config/rix101
nix build ".#darwinConfigurations.${HOSTNAME}.system"
./result/sw/bin/darwin-rebuild switch --flake .
# System setup for `yabai` (in system recovery)
# NOTE: <https://support.apple.com/guide/mac-help/macos-recovery-a-mac-apple-silicon-mchl82829c17/mac>
csrutil enable --without fs --without debug --without nvram
Credits
Misterio77
for his amazingnix-starter-configs
, on which this was based originallydisko
for making disk partioning a breezeoddlama
for creating the amazingagenix-rekey
andnix-topology
projects