2021-09-10 00:42:56 +03:00
|
|
|
{
|
2023-11-01 19:54:06 +03:00
|
|
|
description = "Simplified nix packaging for various programming language ecosystems";
|
2022-07-12 22:45:29 +03:00
|
|
|
|
2021-09-10 00:42:56 +03:00
|
|
|
inputs = {
|
2023-11-01 19:54:06 +03:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2022-11-19 07:16:59 +03:00
|
|
|
|
2023-12-13 09:23:44 +03:00
|
|
|
# TODO: go back to upstream after PRs are merged
|
|
|
|
pyproject-nix.url = "github:davhau/pyproject.nix/dream2nix";
|
2023-11-01 19:54:06 +03:00
|
|
|
pyproject-nix.flake = false;
|
2023-03-24 07:04:04 +03:00
|
|
|
|
2023-11-01 19:54:06 +03:00
|
|
|
purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
|
|
|
|
purescript-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
2021-09-10 00:42:56 +03:00
|
|
|
};
|
|
|
|
|
2023-11-01 19:54:06 +03:00
|
|
|
outputs = inputs: let
|
|
|
|
inherit
|
|
|
|
(builtins)
|
|
|
|
mapAttrs
|
|
|
|
readDir
|
|
|
|
;
|
|
|
|
|
|
|
|
inherit
|
|
|
|
(inputs.nixpkgs.lib)
|
|
|
|
filterAttrs
|
|
|
|
mapAttrs'
|
|
|
|
removeSuffix
|
|
|
|
;
|
|
|
|
|
2023-11-05 06:30:53 +03:00
|
|
|
devFlake = import ./dev-flake;
|
|
|
|
|
2023-11-01 19:54:06 +03:00
|
|
|
modulesDir = ./modules;
|
|
|
|
|
|
|
|
moduleKinds =
|
|
|
|
filterAttrs (_: type: type == "directory") (readDir modulesDir);
|
|
|
|
|
|
|
|
mapModules = kind:
|
|
|
|
mapAttrs'
|
|
|
|
(fn: _: {
|
|
|
|
name = removeSuffix ".nix" fn;
|
|
|
|
value = modulesDir + "/${kind}/${fn}";
|
|
|
|
})
|
|
|
|
(readDir (modulesDir + "/${kind}"));
|
2023-12-03 11:46:10 +03:00
|
|
|
|
|
|
|
# expose core-modules at the top-level
|
|
|
|
corePath = ./modules/dream2nix/core;
|
|
|
|
coreDirs = filterAttrs (name: _: name != "default.nix") (readDir corePath);
|
|
|
|
coreModules =
|
|
|
|
mapAttrs'
|
|
|
|
(fn: _: {
|
|
|
|
name = removeSuffix ".nix" fn;
|
|
|
|
value = corePath + "/${fn}";
|
|
|
|
})
|
|
|
|
(filterAttrs (_: type: type == "regular" || type == "directory") coreDirs);
|
2023-11-05 06:22:03 +03:00
|
|
|
in {
|
2023-12-03 11:46:10 +03:00
|
|
|
modules = let
|
|
|
|
allModules = mapAttrs (kind: _: mapModules kind) moduleKinds;
|
|
|
|
in
|
|
|
|
allModules
|
|
|
|
// {
|
|
|
|
dream2nix = allModules.dream2nix or {} // coreModules;
|
|
|
|
};
|
2023-11-05 06:22:03 +03:00
|
|
|
|
|
|
|
lib = import ./lib {
|
|
|
|
dream2nix = inputs.self;
|
|
|
|
inherit (inputs.nixpkgs) lib;
|
|
|
|
};
|
|
|
|
|
|
|
|
overrides = let
|
|
|
|
overridesDir = ./overrides;
|
|
|
|
in
|
|
|
|
mapAttrs
|
|
|
|
(
|
|
|
|
category: _type:
|
|
|
|
mapAttrs
|
|
|
|
(name: _type: overridesDir + "/${category}/${name}")
|
|
|
|
(readDir (overridesDir + "/${category}"))
|
|
|
|
)
|
|
|
|
(readDir overridesDir);
|
2023-11-05 06:30:53 +03:00
|
|
|
|
|
|
|
inherit
|
|
|
|
(devFlake)
|
|
|
|
checks
|
|
|
|
devShells
|
|
|
|
packages
|
|
|
|
templates
|
|
|
|
;
|
2023-11-01 19:54:06 +03:00
|
|
|
};
|
2021-09-10 00:42:56 +03:00
|
|
|
}
|