Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.05] #342778 #342817

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ in {
nitter = handleTest ./nitter.nix {};
nix-config = handleTest ./nix-config.nix {};
nix-ld = handleTest ./nix-ld.nix {};
nix-serve = handleTest ./nix-serve.nix {};
nix-serve = runTest ./nix-serve.nix;
nix-serve-ssh = handleTest ./nix-serve-ssh.nix {};
nixops = handleTest ./nixops/default.nix {};
nixos-generate-config = handleTest ./nixos-generate-config.nix {};
Expand Down
6 changes: 3 additions & 3 deletions nixos/tests/nix-serve.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ./make-test-python.nix ({ pkgs, ... }:
{ config, ... }:
{
name = "nix-serve";
nodes.machine = { pkgs, ... }: {
Expand All @@ -9,7 +9,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
};
testScript = let
pkgHash = builtins.head (
builtins.match "${builtins.storeDir}/([^-]+).+" (toString pkgs.hello)
builtins.match "${builtins.storeDir}/([^-]+).+" (toString config.node.pkgs.hello)
);
in ''
start_all()
Expand All @@ -19,4 +19,4 @@ import ./make-test-python.nix ({ pkgs, ... }:
"curl --fail -g http://0.0.0.0:5000/nar/${pkgHash}.nar -o /tmp/hello.nar"
)
'';
})
}
3 changes: 3 additions & 0 deletions pkgs/tools/package-management/nix-serve/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ stdenv.mkDerivation {
--add-flags $out/libexec/nix-serve/nix-serve.psgi
'';

/** The nix package that nix-serve got its nix perl bindings from. */
passthru.nix = nix;

passthru.tests = {
nix-serve = nixosTests.nix-serve;
nix-serve-ssh = nixosTests.nix-serve-ssh;
Expand Down
Loading