Files
Claude af18420fd3 Switch to the dendritic flake-parts layout, with stubs for phase 2
flake.nix now only declares inputs and calls flake-parts with import-tree
over ./modules: every .nix file under modules/ is a flake-parts module.
Features are aspects (flake.modules.nixos.<name> and
flake.modules.homeManager.<name>); importing an aspect enables it, so the
my.* option modules and their enable flags are gone.

- Add the flake-parts glue: modules/flake/ (systems, shared meta data,
  host construction through configurations.nixos, overlays, packages,
  apps, dev shell, formatter, checks), modules/users/faumaray.nix
  (meta.owner) and modules/core/{nixpkgs,home-manager,install-facts}.nix.
  config.my is kept as one read-only derived option so install-system
  keeps working unchanged.
- Add the aspects that are already final: secrets, ssh, hyprland,
  wezterm, git, stylix, proxy-suite, gitea-runner and claude-code, and
  the desktop host (modules/hosts/desktop/{host,hardware,disks}.nix).
- Port the always-on basics to the `core` aspect (nix, boot, locale,
  networking, users), lanzaboote and plain systemd-boot to the
  `secure-boot` and `systemd-boot` aspects, and the installer ISO to
  modules/installer/iso.nix. Behaviour is unchanged; the time zone,
  default locale, XKB layouts and the firewall setting now live in
  modules/hosts/desktop/host.nix.
- Move the Lua files (Hyprland settings, binds, rules; Neovim init.lua)
  with git mv, byte-identical.
- Add bare stubs, marked STUB, for the aspects that the next phase
  ports: amd, rocm, gaming, vpn, docker, noctalia, audio, fonts, xdg,
  apps, shell and neovim. The host evaluates with them, but those
  features are not configured until they are ported.
- Remove lib/, overlays/, apps/, modules/nixos/, modules/home/,
  modules/installer/default.nix and hosts/desktop/{default,disks,home}.nix.
- flake.lock: add flake-parts, import-tree, stylix and serena with their
  transitive inputs (22 new nodes); every existing pin is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
2026-10-12 20:55:34 +00:00

109 lines
3.1 KiB
Nix

# Installer ISO (`nix build .#iso`): the minimal NixOS installer plus this
# flake and the install tooling. The installer is not a host: it imports no
# other aspect and has no home-manager.
{
config,
inputs,
lib,
...
}:
let
overlay = config.flake.overlays.default;
in
{
flake.modules.nixos.installer =
{ pkgs, ... }:
let
inherit (pkgs.stdenv.hostPlatform) system;
# Every flake input including nested ones, so the sources are on the ISO and
# a locked flake installs without re-downloading them.
allInputs = builtins.genericClosure {
startSet = map (i: {
key = toString i.outPath;
inherit i;
}) (lib.attrValues inputs);
operator =
x:
map (i: {
key = toString i.outPath;
inherit i;
}) (lib.attrValues (x.i.inputs or { }));
};
in
{
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
# The flake's nixConfig lists binary caches (Noctalia, nix-community).
accept-flake-config = true;
};
# nmtui / nmcli instead of wpa_supplicant.
networking.networkmanager = {
enable = true;
plugins = with pkgs; [
networkmanager-openvpn
];
};
networking.wireless.enable = lib.mkForce false;
environment.systemPackages = [
pkgs.install-system
pkgs.create-keys
pkgs.set-password
pkgs.secret-from-file
pkgs.git
pkgs.jq
pkgs.age
pkgs.sbctl
pkgs.btrfs-progs
pkgs.neovim
inputs.disko.packages.${system}.disko
inputs.agenix.packages.${system}.default
];
# The flake itself, read-only. install-system copies it before changing it.
environment.etc."nixos-config".source = inputs.self;
system.extraDependencies = map (x: x.i.outPath) allInputs;
users.motd = ''
NixOS installer for the "desktop" flake
1. Network: nmtui (Ethernet works out of the box)
2. Install: sudo install-system
(flake: /etc/nixos-config, or --flake DIR for a copy on a stick;
--keys-dir DIR for keys/ on a mounted stick)
3. Keys: create-keys, set-password, secret-from-file (see the README)
install-system asks which disks to use and erases them only after you type the host name.
'';
};
flake.nixosConfigurations.installer = inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
{
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.overlays = [ overlay ];
}
config.flake.modules.nixos.installer
];
};
perSystem =
{ system, ... }:
{
# The ISO is built for x86_64-linux only.
packages = lib.optionalAttrs (system == "x86_64-linux") {
iso = config.flake.nixosConfigurations.installer.config.system.build.isoImage;
};
};
}