2
0
Files
liminix/ci.nix
T

85 lines
2.4 KiB
Nix
Raw Normal View History

2023-01-29 21:42:53 +00:00
{
2024-06-30 16:58:29 +01:00
nixpkgs,
unstable,
liminix,
...
}:
2023-02-05 22:38:21 +00:00
let
2024-06-30 16:58:29 +01:00
pkgs = (import nixpkgs { });
borderVmConf = ./bordervm.conf-example.nix;
2023-02-05 22:38:21 +00:00
inherit (pkgs.lib.attrsets) genAttrs;
devices = [
2024-02-21 19:49:14 +00:00
"gl-ar750"
"gl-mt300a"
"gl-mt300n-v2"
"qemu"
"qemu-aarch64"
"qemu-armv7l"
2024-01-30 11:23:29 +01:00
"tp-archer-ax23"
"zyxel-nwa50ax"
];
2023-02-05 22:38:21 +00:00
vanilla = ./vanilla-configuration.nix;
for-device = name:
2023-02-05 22:38:21 +00:00
(import liminix {
2023-02-20 17:46:07 +00:00
inherit nixpkgs borderVmConf;
2023-02-05 22:38:21 +00:00
device = import (liminix + "/devices/${name}");
liminix-config = vanilla;
2023-02-05 22:38:21 +00:00
}).outputs.default;
tests = import ./tests/ci.nix;
jobs =
2024-06-30 16:58:29 +01:00
(genAttrs devices for-device)
// tests
// {
buildEnv =
(import liminix {
inherit nixpkgs borderVmConf;
device = import (liminix + "/devices/qemu");
liminix-config = vanilla;
}).buildEnv;
doc =
2024-06-30 16:58:29 +01:00
let
json =
(import liminix {
inherit nixpkgs borderVmConf;
device = import (liminix + "/devices/qemu");
liminix-config =
{ ... }:
{
imports = [ ./modules/all-modules.nix ];
};
2024-06-30 16:58:29 +01:00
}).outputs.optionsJson;
in
pkgs.stdenv.mkDerivation {
name = "liminix-doc";
nativeBuildInputs = with pkgs; [
2024-06-30 16:58:29 +01:00
gnumake
sphinx
fennel
luaPackages.lyaml
];
src = ./.;
buildPhase = ''
2024-07-10 23:36:24 +01:00
cat ${json} | fennel --correlate doc/parse-options.fnl > doc/modules-generated.inc.rst
cat ${json} | fennel --correlate doc/parse-options-outputs.fnl > doc/outputs-generated.inc.rst
cp ${(import ./doc/hardware.nix)} doc/hardware.rst
make -C doc html
'';
installPhase = ''
mkdir -p $out/nix-support $out/share/doc/
cd doc
2024-07-10 23:36:24 +01:00
cp *-generated.inc.rst hardware.rst $out
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 20:53:05 +01:00
};
2023-02-05 22:38:21 +00:00
with-unstable = (import liminix {
nixpkgs = unstable;
2023-02-20 17:46:07 +00:00
inherit borderVmConf;
2023-02-05 22:38:21 +00:00
device = import (liminix + "/devices/qemu");
liminix-config = vanilla;
}).outputs.default;
};
2023-03-10 18:41:43 +00:00
in jobs