docs(plan): use self.inputs in top-level imports to avoid module recursion

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Sv2QAunLcLo3tS1YsfLgN
This commit is contained in:
2026-07-24 13:17:11 +02:00
parent 4d42d58126
commit 87b14accac
@@ -11,6 +11,7 @@
## Global Constraints ## Global Constraints
- Do **not** modify `machines/configuration.nix`. `inputs` and `self` are already threaded into every module via `_module.args`; consume them as module arguments. - Do **not** modify `machines/configuration.nix`. `inputs` and `self` are already threaded into every module via `_module.args`; consume them as module arguments.
- **Top-level `imports` must reference flake modules via `self.inputs.*`, not `inputs.*`.** `self` is a specialArg (available during `imports` resolution); `inputs` comes from `_module.args` (config-derived) and using it in an `imports` list causes infinite recursion. Inside the `config` body (including nested `home-manager.users.<name>.imports`), either `inputs` or `self.inputs` is fine.
- Base channel is pinned `nixpkgs/nixos-26.05`; `pkgs.unstable` overlay is available everywhere. quickshell must come from `pkgs.unstable.quickshell` (needs ≥ 0.3.0). - Base channel is pinned `nixpkgs/nixos-26.05`; `pkgs.unstable` overlay is available everywhere. quickshell must come from `pkgs.unstable.quickshell` (needs ≥ 0.3.0).
- home-manager scoped to user `finn` only; `home.stateVersion = "26.05"`. - home-manager scoped to user `finn` only; `home.stateVersion = "26.05"`.
- Follow the existing profile pattern exactly: `let cfg = config.my.profiles.<name>; in { options.my.profiles.<name>.enable = lib.mkEnableOption "..."; config = lib.mkIf cfg.enable { ... }; }`. - Follow the existing profile pattern exactly: `let cfg = config.my.profiles.<name>; in { options.my.profiles.<name>.enable = lib.mkEnableOption "..."; config = lib.mkIf cfg.enable { ... }; }`.
@@ -91,7 +92,7 @@ let
cfg = config.my.profiles.home-manager; cfg = config.my.profiles.home-manager;
in in
{ {
imports = [ inputs.home-manager.nixosModules.home-manager ]; imports = [ self.inputs.home-manager.nixosModules.home-manager ];
options.my.profiles.home-manager.enable = options.my.profiles.home-manager.enable =
lib.mkEnableOption "home-manager integration"; lib.mkEnableOption "home-manager integration";
@@ -156,13 +157,14 @@ Create `modules/environments/dank/default.nix`. Use the exact `homeModules`/`nix
lib, lib,
pkgs, pkgs,
inputs, inputs,
self,
... ...
}: }:
let let
cfg = config.my.profiles.dank; cfg = config.my.profiles.dank;
in in
{ {
imports = [ inputs.dank.nixosModules.dank-material-shell ]; imports = [ self.inputs.dank.nixosModules.dank-material-shell ];
options.my.profiles.dank.enable = lib.mkEnableOption "DankMaterialShell on niri"; options.my.profiles.dank.enable = lib.mkEnableOption "DankMaterialShell on niri";