generated from Patagia/template-nix
parent
ac6a53fac9
commit
a4097b7cc3
14 changed files with 268 additions and 78 deletions
21
flake.nix
21
flake.nix
|
@ -87,10 +87,12 @@
|
|||
pkgs.lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = pkgs.lib.fileset.unions [
|
||||
./api.json
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
(craneLib.fileset.commonCargoSources ./agent)
|
||||
(craneLib.fileset.commonCargoSources ./controller)
|
||||
(craneLib.fileset.commonCargoSources ./xtask)
|
||||
(craneLib.fileset.commonCargoSources crate)
|
||||
];
|
||||
};
|
||||
|
@ -113,16 +115,24 @@
|
|||
}
|
||||
);
|
||||
|
||||
xtask = craneLib.buildPackage (
|
||||
individualCrateArgs
|
||||
// {
|
||||
pname = "xtask";
|
||||
cargoExtraArgs = "-p xtask";
|
||||
src = fileSetForCrate ./xtask;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
# `nix build`
|
||||
packages = {
|
||||
inherit patagia-agent patagia-controller;
|
||||
inherit patagia-agent patagia-controller xtask;
|
||||
};
|
||||
|
||||
# Tests
|
||||
checks = {
|
||||
inherit patagia-agent patagia-controller;
|
||||
inherit patagia-agent patagia-controller xtask;
|
||||
|
||||
clippy = craneLib.cargoClippy (
|
||||
commonArgs
|
||||
|
@ -144,6 +154,13 @@
|
|||
partitionType = "count";
|
||||
}
|
||||
);
|
||||
|
||||
openapi =
|
||||
pkgs.runCommand "openapi" (commonArgs // {
|
||||
src = fileSetForCrate ./xtask;
|
||||
}) ''
|
||||
${self.packages.${system}.xtask}/bin/xtask open-api | ${pkgs.diffutils}/bin/diff -u $src/api.json - | tee $out
|
||||
'';
|
||||
};
|
||||
|
||||
# For `nix fmt`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue