2023-01-29 22:42:53 +01:00
|
|
|
{
|
2024-09-16 18:14:39 +02:00
|
|
|
sources ? import ./lon.nix
|
|
|
|
, nixpkgs ? sources.nixpkgs
|
|
|
|
, unstable ? nixpkgs
|
|
|
|
, liminix ? ./.
|
2023-02-05 23:38:21 +01:00
|
|
|
, ... }:
|
|
|
|
let
|
2024-09-16 18:14:39 +02:00
|
|
|
pkgs = (import nixpkgs { });
|
2023-02-20 18:46:07 +01:00
|
|
|
borderVmConf = ./bordervm.conf-example.nix;
|
2024-09-18 09:10:07 +02:00
|
|
|
inherit (pkgs.lib.attrsets) genAttrs mapAttrs;
|
2023-12-11 20:01:07 +01:00
|
|
|
devices = [
|
2024-02-21 20:49:14 +01:00
|
|
|
"qemu"
|
2024-02-21 20:32:50 +01:00
|
|
|
"zyxel-nwa50ax"
|
2023-12-11 20:01:07 +01:00
|
|
|
];
|
2023-02-05 23:38:21 +01:00
|
|
|
vanilla = ./vanilla-configuration.nix;
|
2023-12-11 20:01:07 +01:00
|
|
|
for-device = name:
|
2023-02-05 23:38:21 +01:00
|
|
|
(import liminix {
|
2023-02-20 18:46:07 +01:00
|
|
|
inherit nixpkgs borderVmConf;
|
2023-02-05 23:38:21 +01:00
|
|
|
device = import (liminix + "/devices/${name}");
|
2023-12-11 20:01:07 +01:00
|
|
|
liminix-config = vanilla;
|
2023-02-05 23:38:21 +01:00
|
|
|
}).outputs.default;
|
2024-09-18 09:10:07 +02:00
|
|
|
tests = mapAttrs (_: v: v { inherit liminix nixpkgs; }) (import ./tests/ci.nix);
|
2023-02-05 23:38:21 +01:00
|
|
|
jobs =
|
2023-12-11 20:01:07 +01:00
|
|
|
(genAttrs devices for-device) //
|
2023-08-07 23:14:58 +02:00
|
|
|
tests //
|
|
|
|
{
|
2023-02-08 01:12:29 +01:00
|
|
|
buildEnv = (import liminix {
|
2023-11-09 20:29:36 +01:00
|
|
|
inherit nixpkgs borderVmConf;
|
2023-02-08 01:12:29 +01:00
|
|
|
device = import (liminix + "/devices/qemu");
|
|
|
|
liminix-config = vanilla;
|
|
|
|
}).buildEnv;
|
2023-11-09 20:29:36 +01:00
|
|
|
doc =
|
|
|
|
let json =
|
|
|
|
(import liminix {
|
|
|
|
inherit nixpkgs borderVmConf;
|
|
|
|
device = import (liminix + "/devices/qemu");
|
|
|
|
liminix-config = {...} : {
|
|
|
|
imports = [ ./modules/all-modules.nix ];
|
|
|
|
};
|
|
|
|
}).outputs.optionsJson;
|
|
|
|
in pkgs.stdenv.mkDerivation {
|
|
|
|
name = "liminix-doc";
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
gnumake sphinx fennel luaPackages.lyaml
|
|
|
|
];
|
|
|
|
src = ./.;
|
|
|
|
buildPhase = ''
|
|
|
|
cat ${json} | fennel --correlate doc/parse-options.fnl > doc/modules-generated.rst
|
2023-11-12 17:55:15 +01:00
|
|
|
cat ${json} | fennel --correlate doc/parse-options-outputs.fnl > doc/outputs-generated.rst
|
2023-11-09 20:29:36 +01:00
|
|
|
cp ${(import ./doc/hardware.nix)} doc/hardware.rst
|
|
|
|
make -C doc html
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/nix-support $out/share/doc/
|
|
|
|
cd doc
|
2023-11-10 00:02:35 +01:00
|
|
|
cp *-generated.rst $out
|
2023-11-09 20:29:36 +01:00
|
|
|
ln -s ${json} $out/options.json
|
|
|
|
cp -a _build/html $out/share/doc/liminix
|
|
|
|
echo "file source-dist \"$out/share/doc/liminix\"" \
|
|
|
|
> $out/nix-support/hydra-build-products
|
|
|
|
'';
|
2023-05-21 21:53:05 +02:00
|
|
|
};
|
2023-02-05 23:38:21 +01:00
|
|
|
with-unstable = (import liminix {
|
|
|
|
nixpkgs = unstable;
|
2023-02-20 18:46:07 +01:00
|
|
|
inherit borderVmConf;
|
2023-02-05 23:38:21 +01:00
|
|
|
device = import (liminix + "/devices/qemu");
|
|
|
|
liminix-config = vanilla;
|
|
|
|
}).outputs.default;
|
|
|
|
};
|
2023-03-10 19:41:43 +01:00
|
|
|
in jobs
|