Parameterizes tests/common.nix and tests/default.nix on proxyServer (default "nginx"), giving flake.nix two nixosConfigurations (test-nginx/test-caddy) and `just build-vm [proxy]` a way to pick between them for interactive testing. The automated nixosTest now boots one node per proxy backend and runs the full assertion suite (factored into check_invoiceninja()) against each, so a regression in either nginx or caddy's config gets caught. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
48 lines
1.3 KiB
Nix
48 lines
1.3 KiB
Nix
{
|
|
description = "An Invoice Ninja package and module.";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
|
|
|
outputs =
|
|
{ self, nixpkgs, nix, }:
|
|
let
|
|
systems = [ "x86_64-linux" ];
|
|
forEachSystem = nixpkgs.lib.genAttrs systems;
|
|
|
|
overlayList = [ self.overlays.default ];
|
|
|
|
pkgsBySystem = forEachSystem (
|
|
system:
|
|
import nixpkgs {
|
|
inherit system;
|
|
overlays = overlayList;
|
|
}
|
|
);
|
|
in
|
|
rec {
|
|
nixosConfigurations = {
|
|
test-nginx = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [ (import ./tests/default.nix { proxyServer = "nginx"; }) ];
|
|
};
|
|
test-caddy = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [ (import ./tests/default.nix { proxyServer = "caddy"; }) ];
|
|
};
|
|
};
|
|
|
|
overlays.default = final: prev: { invoiceninja = final.callPackage ./package.nix { }; };
|
|
|
|
packages = forEachSystem (system: {
|
|
invoiceninja = pkgsBySystem.${system}.invoiceninja;
|
|
default = pkgsBySystem.${system}.invoiceninja;
|
|
});
|
|
|
|
checks = forEachSystem (system: {
|
|
invoiceninja = import ./tests/nixos-test.nix { inherit system; nixpkgsPath = nixpkgs; };
|
|
});
|
|
|
|
nixosModules = import ./nixos-module { overlays = overlayList; };
|
|
};
|
|
}
|