No description
Find a file
2024-08-04 03:12:58 +03:00
.github/workflows chore(cicd): update install-nix-action to v20, add flakehub 2023-11-17 17:44:50 +02:00
apps feat(flake): add apps 2023-02-19 13:54:02 +02:00
hosts fix(jeeves): wireguard IP forwarding 2024-08-02 10:41:18 +03:00
modules chore(packages): indentation 2024-08-04 03:12:58 +03:00
nix refactor(utils)!: promote to a flake module 2024-07-29 02:11:32 +03:00
overlays feat(overlays)!: redefine in terms of createThings 2024-08-04 03:10:58 +03:00
pkgs feat(packages)!: add support for dream2nix 2024-08-02 10:31:26 +03:00
secrets feat(flake)!: convert everything to flake-parts-style flake modules 2024-07-19 01:14:24 +03:00
shells refactor(flake)!: deduplicate code in configurations flake module 2024-07-20 14:30:25 +03:00
templates refactor(flake)!: deduplicate code in configurations flake module 2024-07-20 14:30:25 +03:00
.envrc feat(flake): add .envrc for direnv 2023-10-23 09:05:55 +03:00
.gitignore feat(flake)!: convert everything to flake-parts-style flake modules 2024-07-19 01:14:24 +03:00
default.nix fix(nix): path to compat.nix 2024-07-25 12:23:43 +03:00
flake.lock chore(flake): update flake.lock 2024-08-02 10:50:58 +03:00
flake.nix feat(overlays)!: redefine in terms of createThings 2024-08-04 03:10:58 +03:00
LICENSE feat(config): initial 2022-11-20 17:23:58 +02:00
nixpkgs.nix feat(config): initial 2022-11-20 17:23:58 +02:00
README.md feat(README): mention automatic packages extraction 2024-08-02 10:38:37 +03:00
shell.nix fix(nix): path to compat.nix 2024-07-25 12:23:43 +03:00

nix


Structure

  • Everything is built upon flake-parts, with flake modules for automatic packages, modules && configurations extraction
    • Automatic classic (callPackage) and dream2nix packages extraction
    • Automatic nixos, nix-darwin, nix-on-droid, home-manager and flake modules extraction
    • Automatic nixos, nix-darwin, nix-on-droid and home-manager configurations extraction
  • Hosts can be found under ./hosts/${config-type}/${system}/${hostname}/...
  • Modules can be found under ./modules/${config-type}/...
  • 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

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