diff --git a/flake.nix b/flake.nix index 97528e0..f62b17b 100644 --- a/flake.nix +++ b/flake.nix @@ -42,8 +42,17 @@ { self, ... }@inputs: let inherit (self) outputs; + # every flake "submodule" gets this passed: flakeArg = { - inherit self inputs outputs; + # Usage in submodule: + # { ... }@flakeArg: { } + # add "..." this so new ones can easily be added + inherit + # flake refs + self # reflection + inputs # evaluated inputs + outputs # evaluated outputs + ; }; # constants system = "x86_64-linux"; diff --git a/nix/README.md b/nix/README.md index eda1938..ec0fa03 100644 --- a/nix/README.md +++ b/nix/README.md @@ -1,3 +1,5 @@ +# nix configs & modules + This directory contains all nix-related (esp. NixOS) files. Normally, I would have placed these directories on the same level as flake.nix, but: @@ -7,3 +9,8 @@ Normally, I would have placed these directories on the same level as flake.nix, (i.e. also including systems without NixOS) it also contains files for different systems. These should be separated from nix files, in general. + + +## flakeArg + +Every flake "submodule" gets passed a `flakeArg` parameter to access the flakeā€™s inputs & outputs and other goodies. This is documented in ../flake.nix.