From 20934137a63b77ece9d513dbf0ff752dd84c8572 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Mon, 8 Apr 2024 19:41:25 -0700 Subject: [PATCH] update flakes arent real --- content/posts/flakes-arent-real.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/posts/flakes-arent-real.md b/content/posts/flakes-arent-real.md index 01df387..5d0ceb3 100644 --- a/content/posts/flakes-arent-real.md +++ b/content/posts/flakes-arent-real.md @@ -454,6 +454,12 @@ actually invoking `nixpkgs.lib.nixosSystem`. The latter is the much more sinister part, and the reason I would strongly recommend inline modules with closures instead of `specialArgs`: they break flake composition. +That being said, *either* using `specialArgs` *or* an inline module inside +`flake.nix`, rather than an option above, is the only way to inject module +imports. That is, if one uses some option like `imports = [ config.someOption +]`, it will cause an infinite recursion error. We would suggest putting the +imports inside an inline module inside `flake.nix` for this case. + To use `specialArgs`, an attribute set is passed into `nixpkgs.lib.nixosSystem`, which then land in the arguments of NixOS modules: