add example for defining projects as attrs

This commit is contained in:
DavHau 2022-12-13 13:40:46 +07:00
parent a62727de80
commit 011b8ba238
2 changed files with 31 additions and 0 deletions

View File

@ -87,6 +87,9 @@ Extensive Example `flake.nix`:
config.projectRoot = ./.;
source = ./.;
# `projects` can alternatively be an attrset.
# `projects` can be omitted if `autoProjects = true` is defined.
projects = ./projects.toml;
# Configure the behavior of dream2nix when translating projects.

View File

@ -0,0 +1,28 @@
{
inputs = {
dream2nix.url = "github:nix-community/dream2nix";
src.url = "github:yusdacra/linemd/v0.4.0";
src.flake = false;
};
outputs = {
self,
dream2nix,
src,
} @ inp:
(dream2nix.lib.makeFlakeOutputs {
systems = ["x86_64-linux"];
config.projectRoot = ./.;
source = src;
projects = {
linemd = {
name = "linemd";
subsystem = "rust";
translator = "cargo-lock";
};
};
})
// {
# checks.x86_64-linux.linemd = self.packages.x86_64-linux.linemd;
};
}