mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-25 07:25:33 +03:00
d8e4b477e3
The goal is to reduce the flake inputs visible to the user Still, the top-level flake re-exposes the outputs of the dev-flake, but without exposing its inputs. This means a devShell is still available in the top-level, for example. This also removes the /modules/flake.nix. Its original purpose was separating the modules inputs from the development inputs, but this is now done the opposite way around by moving the dev inputs to /dev-flake/flake.nix.
53 lines
1.0 KiB
Nix
53 lines
1.0 KiB
Nix
{
|
|
self,
|
|
lib,
|
|
...
|
|
}: {
|
|
perSystem = {
|
|
config,
|
|
self',
|
|
inputs',
|
|
pkgs,
|
|
...
|
|
}: let
|
|
excludes = [
|
|
# NOT WORKING
|
|
# TODO: fix those
|
|
"nixpkgs-overrides"
|
|
"core"
|
|
"flags"
|
|
"ui"
|
|
"docs"
|
|
"env"
|
|
"assertions"
|
|
|
|
# doesn't need to be rendered
|
|
"_template"
|
|
];
|
|
in {
|
|
render.inputs =
|
|
lib.flip lib.mapAttrs
|
|
(lib.filterAttrs
|
|
(name: module:
|
|
! (lib.elem name excludes))
|
|
(self.modules.dream2nix))
|
|
(name: module: {
|
|
title = name;
|
|
module = self.modules.dream2nix.${name};
|
|
sourcePath = self;
|
|
attributePath = [
|
|
"dream2nix"
|
|
"modules"
|
|
"dream2nix"
|
|
(lib.strings.escapeNixIdentifier name)
|
|
];
|
|
intro =
|
|
if lib.pathExists (../dream2nix/${name}/README.md)
|
|
then lib.readFile (../dream2nix/${name}/README.md)
|
|
else "";
|
|
baseUrl = "https://github.com/nix-community/dream2nix/blob/master";
|
|
separateEval = true;
|
|
});
|
|
};
|
|
}
|