2023-01-29 22:42:53 +01:00
|
|
|
{
|
2023-02-05 23:38:21 +01:00
|
|
|
nixpkgs
|
|
|
|
, unstable
|
|
|
|
, liminix
|
|
|
|
, ... }:
|
|
|
|
let
|
|
|
|
inherit (builtins) map;
|
|
|
|
pkgs = (import nixpkgs {});
|
2023-02-20 18:46:07 +01:00
|
|
|
borderVmConf = ./bordervm.conf-example.nix;
|
2023-02-05 23:38:21 +01:00
|
|
|
inherit (pkgs.lib.attrsets) genAttrs;
|
2023-09-20 22:03:51 +02:00
|
|
|
devices = {
|
2023-11-05 21:56:25 +01:00
|
|
|
virt = [ "qemu" "qemu-aarch64" "qemu-armv7l" ];
|
2023-09-20 22:03:51 +02:00
|
|
|
hw = [ "gl-ar750" "gl-mt300n-v2" "gl-mt300a" ];
|
|
|
|
};
|
2023-02-05 23:38:21 +01:00
|
|
|
vanilla = ./vanilla-configuration.nix;
|
2023-09-20 22:03:51 +02:00
|
|
|
for-device = cfg: 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-09-20 22:03:51 +02:00
|
|
|
liminix-config = cfg;
|
2023-02-05 23:38:21 +01:00
|
|
|
}).outputs.default;
|
|
|
|
tests = import ./tests/ci.nix;
|
|
|
|
jobs =
|
2023-09-20 22:03:51 +02:00
|
|
|
(genAttrs devices.hw (name: for-device ./vanilla-configuration-hw.nix name)) //
|
|
|
|
(genAttrs devices.virt (name: for-device vanilla name)) //
|
2023-08-07 23:14:58 +02:00
|
|
|
tests //
|
|
|
|
{
|
2023-02-08 01:12:29 +01:00
|
|
|
buildEnv = (import liminix {
|
2023-02-20 18:46:07 +01:00
|
|
|
inherit nixpkgs borderVmConf;
|
2023-02-08 01:12:29 +01:00
|
|
|
device = import (liminix + "/devices/qemu");
|
|
|
|
liminix-config = vanilla;
|
|
|
|
}).buildEnv;
|
2023-05-21 21:53:05 +02:00
|
|
|
doc = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "liminix-doc";
|
2023-08-07 23:14:58 +02:00
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
gnumake sphinx
|
|
|
|
fennel luaPackages.lyaml
|
|
|
|
];
|
2023-05-21 21:53:05 +02:00
|
|
|
src = ./doc;
|
|
|
|
buildPhase = ''
|
2023-08-11 22:12:57 +02:00
|
|
|
cat ${(import ./doc/extract-options.nix).doc} > options.json
|
2023-09-17 18:46:06 +02:00
|
|
|
cat options.json | fennel --correlate parse-options.fnl > modules-generated.rst
|
2023-09-28 13:17:30 +02:00
|
|
|
cp ${(import ./doc/hardware.nix)} hardware.rst
|
2023-05-21 22:27:52 +02:00
|
|
|
make html
|
2023-05-21 21:53:05 +02:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
2023-05-21 22:27:52 +02:00
|
|
|
mkdir -p $out/nix-support $out/share/doc/
|
2023-08-11 22:12:57 +02:00
|
|
|
cp modules.rst options.json $out
|
2023-05-21 22:27:52 +02:00
|
|
|
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
|