mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 14:31:55 +03:00
Merge pull request #465 from max-privatevoid/flake-module-tweaks
flake-parts: add builder option + don't expose packages automatically
This commit is contained in:
commit
b4b491bd77
@ -29,6 +29,9 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
packages = {
|
||||
inherit (config.dream2nix.outputs.prettier.packages) prettier;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -5,14 +5,6 @@
|
||||
}: let
|
||||
l = lib // builtins;
|
||||
d2n = config.dream2nix;
|
||||
|
||||
# make attrs default, so that users can override them without
|
||||
# needing to use lib.mkOverride (usually, lib.mkForce)
|
||||
mkDefaultRecursive = attrs:
|
||||
l.mapAttrsRecursiveCond
|
||||
d2n.lib.dlib.isNotDrvAttrs
|
||||
(_: l.mkDefault)
|
||||
attrs;
|
||||
in {
|
||||
config = {
|
||||
perSystem = {
|
||||
@ -29,20 +21,9 @@ in {
|
||||
l.mapAttrs
|
||||
(_: args: instance.dream2nix-interface.makeOutputs args)
|
||||
config.dream2nix.inputs;
|
||||
|
||||
getAttrFromOutputs = attrName:
|
||||
l.mkMerge (
|
||||
l.mapAttrsToList
|
||||
(_: output: mkDefaultRecursive output.${attrName} or {})
|
||||
outputs
|
||||
);
|
||||
in {
|
||||
config = {
|
||||
dream2nix = {inherit instance outputs;};
|
||||
# TODO(yusdacra): we could combine all the resolveImpure here if there are multiple
|
||||
# TODO(yusdacra): maybe we could rename outputs with the same name to avoid collisions?
|
||||
packages = getAttrFromOutputs "packages";
|
||||
devShells = getAttrFromOutputs "devShells";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -37,6 +37,14 @@
|
||||
type = t.str;
|
||||
};
|
||||
|
||||
# TODO make an enum of all available builders?
|
||||
builder = mkOption {
|
||||
default = null;
|
||||
description = ''Name of builder to use'';
|
||||
example = "strict-builder";
|
||||
type = t.nullOr t.str;
|
||||
};
|
||||
|
||||
subsystemInfo = mkOption {
|
||||
default = {};
|
||||
description = "Translator specific arguments";
|
||||
|
@ -28,6 +28,9 @@
|
||||
translator = "my-pure-translator";
|
||||
};
|
||||
};
|
||||
packages = {
|
||||
inherit (config.dream2nix.outputs.niv.packages) default;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user