2024-11-13 15:24:40 +01:00
|
|
|
{ sources ? import ./npins
|
|
|
|
, system ? builtins.currentSystem
|
|
|
|
, pkgs ? import sources.nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
config = { };
|
|
|
|
overlays = [ ];
|
|
|
|
}
|
|
|
|
, lib ? import "${sources.nixpkgs}/lib"
|
|
|
|
}:
|
2024-11-13 15:24:41 +01:00
|
|
|
let
|
2024-11-13 15:24:41 +01:00
|
|
|
lib' = final: prev:
|
|
|
|
let
|
|
|
|
new = import ./lib.nix { lib = final; };
|
|
|
|
in
|
|
|
|
new // { types = prev.recursiveUpdate prev.types new.types; };
|
2024-11-13 15:24:41 +01:00
|
|
|
lib'' = lib.extend lib';
|
2024-11-27 11:21:59 +01:00
|
|
|
|
2024-11-13 15:24:41 +01:00
|
|
|
in
|
2024-11-13 15:24:41 +01:00
|
|
|
rec {
|
2024-11-27 10:39:07 +01:00
|
|
|
lib = lib'';
|
|
|
|
result = lib.evalModules {
|
2024-11-13 15:24:41 +01:00
|
|
|
modules = [
|
|
|
|
./structure
|
|
|
|
./content
|
|
|
|
./presentation
|
|
|
|
{
|
|
|
|
_module.args = {
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-11-13 15:24:41 +01:00
|
|
|
|
2024-11-13 15:24:41 +01:00
|
|
|
inherit (result.config) build;
|
2024-11-13 15:24:40 +01:00
|
|
|
|
2024-11-27 11:21:59 +01:00
|
|
|
shell =
|
|
|
|
let
|
|
|
|
run-tests = pkgs.writeShellApplication {
|
|
|
|
name = "run-tests";
|
|
|
|
text = with pkgs; with lib; ''
|
|
|
|
${getExe nix-unit} ${toString ./tests.nix} "$@"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
test-loop = pkgs.writeShellApplication {
|
|
|
|
name = "test-loop";
|
|
|
|
text = with pkgs; with lib; ''
|
|
|
|
${getExe watchexec} -w ${toString ./.} -- ${getExe nix-unit} ${toString ./tests.nix}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
devmode = pkgs.devmode.override {
|
|
|
|
buildArgs = "${toString ./.} -A build --show-trace";
|
|
|
|
open = "/index.html";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.mkShellNoCC {
|
|
|
|
packages = [
|
|
|
|
pkgs.npins
|
|
|
|
run-tests
|
|
|
|
test-loop
|
|
|
|
devmode
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
tests = with pkgs; with lib; runCommand "run-tests" { } ''
|
|
|
|
touch $out
|
|
|
|
${getExe nix-unit} ${./tests.nix} "$@"
|
|
|
|
'';
|
2024-11-13 15:24:40 +01:00
|
|
|
}
|