openapi: put a static version into the repository

This avoids a lot of rebuilds and we can also track api changes better
This commit is contained in:
Jörg Thalheim
2023-11-24 15:32:31 +01:00
parent 4a19e3af95
commit d394792238
7 changed files with 985 additions and 20 deletions

View File

@@ -1,7 +1,6 @@
{ floco
, system
, pkgs
, clanPkgs
}:
let
@@ -25,9 +24,7 @@ let
{ config.floco.settings = { inherit system; basedir = ./.; }; }
./nix/floco-cfg.nix
];
specialArgs = {
inherit pkgs clanPkgs;
};
specialArgs = { inherit pkgs; };
};
# This attrset holds a few derivations related to our package.

View File

@@ -1,9 +1,9 @@
{ self, ... }:
{
perSystem = { self', pkgs, ... }:
perSystem = { pkgs, ... }:
let
inherit (self.inputs) floco;
base = pkgs.callPackage ./default.nix { inherit floco; clanPkgs = self'.packages; };
base = pkgs.callPackage ./default.nix { inherit floco; };
in
{
packages = {
@@ -16,7 +16,6 @@
devShells.ui = pkgs.callPackage ./shell.nix {
inherit pkgs;
inherit (base) fmod pkg;
clanPkgs = self'.packages;
};
};
}

View File

@@ -1,4 +1,4 @@
{ lib, config, pkgs, clanPkgs, ... }:
{ lib, config, pkgs, ... }:
let
pjs =
@@ -73,7 +73,7 @@ in
echo "----------- GENERATE API TS ------------"
cp ${clanPkgs.clan-openapi}/openapi.json .
cp ${../../clan-cli/clan_cli/webui/openapi.json} openapi.json
./node_modules/.bin/orval
ln -fs ${pkgs.roboto}/share/fonts ./src/

View File

@@ -1,7 +1,6 @@
{ fmod
, pkg
, pkgs
, clanPkgs
}:
pkgs.mkShell {
buildInputs = [
@@ -26,7 +25,7 @@ pkgs.mkShell {
# re-generate the api code
rm -rf src/api openapi.json
cp ${clanPkgs.clan-openapi}/openapi.json .
cp ${../../pkgs/clan-cli/clan_cli/webui/openapi.json} .
orval
'';
}