From 87b14accac1e9126dcb722c4ce4a9c5b3a89c987 Mon Sep 17 00:00:00 2001 From: "Finn@MiBook" Date: Fri, 24 Jul 2026 13:17:11 +0200 Subject: [PATCH] docs(plan): use self.inputs in top-level imports to avoid module recursion Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_018Sv2QAunLcLo3tS1YsfLgN --- docs/superpowers/plans/2026-07-24-dank-material-shell.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/superpowers/plans/2026-07-24-dank-material-shell.md b/docs/superpowers/plans/2026-07-24-dank-material-shell.md index e714434..8798ca3 100644 --- a/docs/superpowers/plans/2026-07-24-dank-material-shell.md +++ b/docs/superpowers/plans/2026-07-24-dank-material-shell.md @@ -11,6 +11,7 @@ ## 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. +- **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..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). - home-manager scoped to user `finn` only; `home.stateVersion = "26.05"`. - Follow the existing profile pattern exactly: `let cfg = config.my.profiles.; in { options.my.profiles..enable = lib.mkEnableOption "..."; config = lib.mkIf cfg.enable { ... }; }`. @@ -91,7 +92,7 @@ let cfg = config.my.profiles.home-manager; in { - imports = [ inputs.home-manager.nixosModules.home-manager ]; + imports = [ self.inputs.home-manager.nixosModules.home-manager ]; options.my.profiles.home-manager.enable = lib.mkEnableOption "home-manager integration"; @@ -156,13 +157,14 @@ Create `modules/environments/dank/default.nix`. Use the exact `homeModules`/`nix lib, pkgs, inputs, + self, ... }: let cfg = config.my.profiles.dank; 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";