Skip to content

Commit

Permalink
[Backport release-24.05] #342778 (#342817)
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Sep 18, 2024
2 parents 4e39c8b + 6c5f114 commit 3a458f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,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

1 comment on commit 3a458f7

@vcunat
Copy link
Member

@vcunat vcunat commented on 3a458f7 Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the commit message for this merge isn't great.

Please sign in to comment.