nix: Re-enable and fix basic nix flake check for nix package and module (#3425)

Co-authored-by: Weston Keele <wekeele@proton.me>
This commit is contained in:
Weston Keele (whisky)
2025-10-29 14:58:43 +00:00
committed by GitHub
parent 248fcc06ab
commit 26780df065
3 changed files with 14 additions and 8 deletions

View File

@@ -145,6 +145,7 @@
nixpkgs.overlays = [ self.overlays.${system}.default ];
};
checks = { };
checks =
import ./nix/tests { inherit pkgs; flake = self; };
});
}

View File

@@ -1,4 +1,4 @@
{ pkgs, makeTest, inputs }:
{ pkgs, flake }:
{
vmTest = import ./nixos-module { inherit pkgs makeTest inputs; };
vmTest = import ./nixos-module { inherit pkgs flake; };
}

View File

@@ -1,16 +1,19 @@
{ pkgs, makeTest, inputs }:
makeTest {
{ pkgs, flake }:
pkgs.nixosTest {
name = "lnbits-nixos-module";
nodes = {
client = { config, pkgs, ... }: {
environment.systemPackages = [ pkgs.curl ];
};
lnbits = { ... }: {
imports = [ inputs.self.nixosModules.default ];
imports = [ flake.nixosModules.${pkgs.system}.default ];
services.lnbits = {
enable = true;
openFirewall = true;
host = "0.0.0.0";
env = {
LNBITS_ADMIN_UI = "false";
};
};
};
};
@@ -19,8 +22,10 @@ makeTest {
lnbits.wait_for_open_port(${toString nodes.lnbits.config.services.lnbits.port})
client.wait_for_unit("multi-user.target")
with subtest("Check that the lnbits webserver can be reached."):
assert "<title>LNbits</title>" in client.succeed(
"curl -sSf http:/lnbits:8231/ | grep title"
output = client.succeed(
"curl -sSf http://lnbits:8231/ | grep title | head -n1"
)
assert "<title>LNbits</title>" in output;
'';
}