My configs for both nixos and home manager only machines
Find a file
2025-10-12 21:17:19 +02:00
configs added config for personal laptop, now named Harmatan. 2025-10-12 21:17:19 +02:00
hosts added config for personal laptop, now named Harmatan. 2025-10-12 21:17:19 +02:00
lib Restic: made modular backup declerations. 2025-04-13 15:27:25 +02:00
modules fix to git hist. 2025-09-19 12:40:09 +02:00
packages new machine, altostratus, my remote-work remote box. 2025-09-24 15:02:57 +02:00
roles fixed a few things in embedded dev role. 2025-09-26 15:09:48 +02:00
templates ran formatter. 2025-02-25 12:49:21 +01:00
.editorconfig added editorconfig file. 2025-04-14 10:49:16 +02:00
.envrc start of a latepanda config. 2024-05-24 15:23:56 -05:00
.gitignore start of a latepanda config. 2024-05-24 15:23:56 -05:00
flake.lock flake update. 2025-10-08 13:40:31 +02:00
flake.nix added config for personal laptop, now named Harmatan. 2025-10-12 21:17:19 +02:00
justfile Replaced nixvim with nix-cats external flake. 2025-07-04 22:13:25 +02:00
LICENSE Initial commit 2024-03-24 01:38:27 +00:00
README.md new machine, altostratus, my remote-work remote box. 2025-09-24 15:02:57 +02:00

nix-config

My configs for both nixos and home manager only machines

structure

.
├── flake.nix
├── configs
│   ├── home-manager
│   └── nixos
├── hosts
├── modules
│   ├── home-manager
│   └── hostopts.nix
├── roles
│   ├── home-manager
│   └── nixos
└── templates
  • Configs set options and specify programs to be installed. They do not specify their own options, and take effect as soon as they are imported. Generally, a config will be specific to a single program, and possibly optional dependecies of the main program.
  • Hosts define specific hosts. They are the entry point into the system. Each host must import configs/nixos/common.nix in the top level and configs/home-manager/common.nix in the home-manager block. Each host must also define the variables declared in modules/hostopts.nix.
  • Modules are always imported by the respective common.nix. They each have an enable option, and only have effects if enabled.
  • Roles are larger bundles of software and options. They define packages to be installed and may import configurations or enable modules.

Secrets

This repo uses nix-sops for secrets management, with the encrypted secrets being stored in a private repo imported as an input. if the nix-secrets input is commented out, the repo should still build, gracefully degrading to default, non-secret, values.

Spinning up a new machine:

run nix build ./#iso or nix build aarch64-iso.nix (depending on architecture), and boot it while on the same network. (you can also use a regular nixos iso, but this has my tools and pub ssh keys already on it.) SSH into the machine (hostname will be nixos-installer), and run nixos-generate --show-hardware-config, and copy the kernel modules section into your config. run ls /dev/disk/by-id, and note the disk IDs.

Now your ready to write a config. You should probably base it off of one of the other configs in hosts. Just modify it to your needs (adding roles, importing other configs, setting up networking, etc) and write a disk-config.nix for it. now, run nix run github:nix-community/nixos-anywhere -- --flake .\#$CONFIG_NAME root@nixos-installer, and nixos anywhere will do the rest. If the machine is headless, you probably also want to add an entry to the deploy config, to update it remotely.