From 91c72a02db185caf79d34e7dcd1a84cccae57665 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sun, 25 Aug 2024 13:47:23 +0200 Subject: [PATCH] establish flakeArg construct & add docu --- flake.nix | 11 ++++++++++- nix/README.md | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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.