Skip to content
/ dendrix Public

Commit e7d188c

Browse files
committed
Mention flake-file on minimalistic flake.nix section
1 parent f6a3df9 commit e7d188c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

dev/book/src/Dendritic.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,20 @@ This means we can have:
120120

121121
### Minimal and focused flake.nix
122122

123-
Instead of having huge `flake.nix` files with lots of nix logic inside the flake itself.
124-
It is now possible move to all nix logic into `./modules`.
123+
Instead of having huge `flake.nix` files with lots of nix logic inside. It is now possible
124+
to move all nix logic into well organized auto-imported flake-parts in `./modules`. This way, `flake.nix` serves more as a manifest of dependencies and flake entrypoint.
125125

126-
Your flake becomes minimal, focused on defining inputs and possibly cache, experimental-features config.
126+
Some people go a step further and use [vic/flake-file](https://github.com/vic/flake-file) to manage their flake.nix automatically, by letting each flake-part module also define the flake inputs needed by each module.
127127

128-
And any file inside modules can contribute to flake outputs (packages/checks/osConfigurations) as needed.
128+
Any flake-parts module can contribute to flake.nix as needed, either inputs/flake-configuration (by using `vic/flake-file`) or outputs (modules/packages/checks/osConfigurations/etc).
129129

130130
```nix
131-
# modules/flake/formatter.nix
131+
# ./modules/home/vim.nix
132+
{ inputs, ... }:
132133
{
133-
perSystem = {pkgs, ...}: {
134-
formatter = pkgs.alejandra;
134+
flake-file.inputs.nixvim.url = "github:nix-community/nixvim";
135+
flake.modules.homeManager.vim = {
136+
# use inputs.nixvim
135137
};
136138
}
137139
```

0 commit comments

Comments
 (0)