mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-23 09:04:37 +03:00
refactor: change projects -> inputs, make option description more explanatory
This commit is contained in:
parent
5fd403b090
commit
cc3020a32f
@ -16,29 +16,14 @@
|
||||
}:
|
||||
flake-parts.lib.mkFlake {inherit self;} {
|
||||
systems = ["x86_64-linux"];
|
||||
imports = [dream2nix.flakeModule];
|
||||
imports = [dream2nix.flakeModuleBeta];
|
||||
dream2nix = {
|
||||
config.projectRoot = ./.;
|
||||
projects."ripgrep" = {
|
||||
# define an input for dream2nix to generate outputs for
|
||||
inputs."ripgrep" = {
|
||||
source = src;
|
||||
settings = [{builder = "crane";}];
|
||||
};
|
||||
};
|
||||
perSystem = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config.dream2nix) outputs;
|
||||
in {
|
||||
packages.ripgrep = outputs.packages.ripgrep.overrideAttrs (old: {
|
||||
buildInputs = (old.buildInputs or []) ++ [pkgs.hello];
|
||||
postInstall = ''
|
||||
${old.postInstall or ""}
|
||||
hello
|
||||
'';
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -194,7 +194,7 @@
|
||||
# kept for compat
|
||||
lib2 = d2n-lib;
|
||||
|
||||
flakeModule = {
|
||||
flakeModuleBeta = {
|
||||
imports = [./src/modules/flake-parts];
|
||||
dream2nix.lib = d2n-lib;
|
||||
};
|
||||
|
@ -14,7 +14,7 @@
|
||||
outputs = d2n.lib.dlib.mergeFlakes (
|
||||
l.map
|
||||
(p: d2n.lib.makeFlakeOutputs (makeArgs p))
|
||||
(l.attrValues d2n.projects)
|
||||
(l.attrValues d2n.inputs)
|
||||
);
|
||||
in {
|
||||
config = {
|
||||
|
@ -22,14 +22,21 @@ in {
|
||||
};
|
||||
default = {};
|
||||
description = ''
|
||||
The dream2nix config.
|
||||
The dream2nix config. This will be applied to all defined `sources`.
|
||||
You can override this per `source` by specifying `config` for that source:
|
||||
```nix
|
||||
sources."name" = {
|
||||
config.projectSource = ./source;
|
||||
};
|
||||
```
|
||||
'';
|
||||
};
|
||||
projects = l.mkOption {
|
||||
type = t.attrsOf t.raw;
|
||||
inputs = l.mkOption {
|
||||
type = t.attrsOf t.attrs;
|
||||
default = {};
|
||||
description = ''
|
||||
The projects that outputs will be generated for.
|
||||
A list of inputs to generate outputs from.
|
||||
Each one takes the same arguments `makeFlakeOutputs` takes.
|
||||
'';
|
||||
};
|
||||
outputs = l.mkOption {
|
||||
|
Loading…
Reference in New Issue
Block a user