feat(hosts): example template host

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-06-28 06:48:38 +02:00
commit efe328eb7b
2 changed files with 90 additions and 0 deletions

46
hosts/example/default.nix Normal file
View file

@ -0,0 +1,46 @@
# hosts/example/ — copy-me template for a new Omnixient host.
#
# Adopt in five steps:
# 1. cp -r hosts/example hosts/<yourhost>
# 2. Generate YOUR hardware scan (replaces the placeholder):
# sudo nixos-generate-config --show-hardware-config \
# > hosts/<yourhost>/hardware-configuration.nix
# 3. Add a host entry in flake.nix (copy the `example` block, rename it
# to <yourhost>). Add `devEnv = true;` only if you want the dev-env.
# 4. Fill in settings.nix (user, hostName, stateVersion, sshKeys, …).
# If your username differs from the template's, also create
# users/<youruser>/home-manager.nix (copy users/user/home-manager.nix).
# 5. sudo nixos-rebuild switch --flake .#<yourhost>
#
# Everything here is intentionally minimal — no maintainer-specific
# hardware modules, VPN tunnels, fwupd quirks, or dev-env. Add what you
# want through packs. See docs/getting-started.md and docs/packs.md.
{ lib, inputs, settings, ... }:
{
imports = [
# Your machine's hardware scan. The committed file is a PLACEHOLDER —
# replace it (step 2) before building on real hardware.
./hardware-configuration.nix
# Optional: a nixos-hardware module for your exact model, e.g.
# inputs.nixos-hardware.nixosModules.framework-13-7040-amd
# inputs.nixos-hardware.nixosModules.dell-xps-15-9520
# (full list: https://github.com/NixOS/nixos-hardware)
# Shared Omnixient base: system + Hyprland desktop + theming.
../../configuration.nix
# Optional: shared binary caches (substituters + trusted keys).
# ../../modules/cache.nix
];
# Opt into the goodies you want — see docs/packs.md for the full catalog.
omni.packs = {
development.enable = true;
media.enable = true;
containers.enable = true;
# gaming.enable = true;
# office.enable = true;
# bitcoin.enable = true; # needs an explicit import — see docs/packs.md
};
}

View file

@ -0,0 +1,44 @@
# PLACEHOLDER hardware scan — REPLACE before building on real hardware:
# sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix
#
# This generic stub exists only so the `example` host evaluates/builds as a
# template (and so the template can't silently rot in CI). The by-label
# devices below will NOT match your machine — a real scan captures your
# actual disks, filesystems, kernel modules, and CPU microcode.
#
# hostPlatform is set by lib/mksystem.nix; the bootloader (systemd-boot)
# by modules/boot.nix — so this file only needs filesystems.
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"ahci"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
}