feat: define projects via attrset, rename flakePartsModule to flakeModule

This commit is contained in:
Yusuf Bera Ertan 2022-10-29 03:57:38 +03:00
parent f15d2efa0b
commit 5fd403b090
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA
4 changed files with 11 additions and 11 deletions

View File

@ -16,15 +16,13 @@
}:
flake-parts.lib.mkFlake {inherit self;} {
systems = ["x86_64-linux"];
imports = [dream2nix.flakePartsModule];
imports = [dream2nix.flakeModule];
dream2nix = {
config.projectRoot = ./.;
projects = [
{
source = src;
settings = [{builder = "crane";}];
}
];
projects."ripgrep" = {
source = src;
settings = [{builder = "crane";}];
};
};
perSystem = {
config,

View File

@ -194,7 +194,7 @@
# kept for compat
lib2 = d2n-lib;
flakePartsModule = {
flakeModule = {
imports = [./src/modules/flake-parts];
dream2nix.lib = d2n-lib;
};

View File

@ -12,7 +12,9 @@
}
// p;
outputs = d2n.lib.dlib.mergeFlakes (
l.map (p: d2n.lib.makeFlakeOutputs (makeArgs p)) d2n.projects
l.map
(p: d2n.lib.makeFlakeOutputs (makeArgs p))
(l.attrValues d2n.projects)
);
in {
config = {

View File

@ -26,8 +26,8 @@ in {
'';
};
projects = l.mkOption {
type = t.listOf t.raw;
default = [];
type = t.attrsOf t.raw;
default = {};
description = ''
The projects that outputs will be generated for.
'';