From ed72e91db150f2e3778dee5fa13f5802e14fd2e5 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 2 Oct 2024 10:57:28 +0200 Subject: [PATCH 1/2] nixos/mihomo: fix option type --- nixos/modules/services/networking/mihomo.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/mihomo.nix b/nixos/modules/services/networking/mihomo.nix index a425952b54ce..05d3d304d460 100644 --- a/nixos/modules/services/networking/mihomo.nix +++ b/nixos/modules/services/networking/mihomo.nix @@ -18,7 +18,7 @@ in package = lib.mkPackageOption pkgs "mihomo" { }; configFile = lib.mkOption { - type = lib.types.nullOr lib.types.path; + type = lib.types.path; description = "Configuration file to use."; }; From 93da11def19632826d95ee7b148f20bf6baccc00 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 2 Oct 2024 10:58:02 +0200 Subject: [PATCH 2/2] nixos/tests/mihomo: implement check correctly, fix target value --- nixos/tests/mihomo.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/tests/mihomo.nix b/nixos/tests/mihomo.nix index 472d10050f7f..a456facb4367 100644 --- a/nixos/tests/mihomo.nix +++ b/nixos/tests/mihomo.nix @@ -39,6 +39,8 @@ import ./make-test-python.nix ({ pkgs, ... }: { machine.fail("curl --fail --max-time 10 --proxy socks5://user:supervillain@localhost:7890 http://localhost") # Web UI - machine.succeed("curl --fail http://localhost:9090") == '{"hello":"clash"}' + result = machine.succeed("curl --fail http://localhost:9090") + target = '{"hello":"mihomo"}\n' + assert result == target, f"{result!r} != {target!r}" ''; })