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

Test perl bindings with nix-serve #11531

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
description = "The purely functional package manager";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446";
inputs.flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
Expand Down Expand Up @@ -139,6 +139,12 @@

nix = final.nixComponents.nix;

nix-serve =
prev.nix-serve.override {
# undo potential version pinning
nix = final.nix;
};

# See https://github.com/NixOS/nixpkgs/pull/214409
# Remove when fixed in this flake's nixpkgs
pre-commit =
Expand Down
5 changes: 5 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
, mdbook
, mdbook-linkcheck
, mercurial
, nix-perl-bindings
, openssh
, openssl
, pkg-config
Expand Down Expand Up @@ -334,6 +335,10 @@ in {

hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";

passthru = lib.optionalAttrs (stdenv.buildPlatform.canExecute stdenv.hostPlatform) {
perl-bindings = nix-perl-bindings;
};

Comment on lines +338 to +341
Copy link
Member

Choose a reason for hiding this comment

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

I think I would rather not do that here (it doesn't work with the split packages so well), and instead just slap on the attribute for the nix-serve override.

meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows;
mainProgram = "nix";
Expand Down
3 changes: 3 additions & 0 deletions packaging/everything.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,8 @@
nix-main-c
;
};
}
// lib.optionalAttrs (stdenv.buildPlatform.canExecute stdenv.hostPlatform) {
perl-bindings = nix-perl-bindings;
};
})
7 changes: 7 additions & 0 deletions tests/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,10 @@ in

cgroups = runNixOSTestFor "x86_64-linux" ./cgroups;
}
// (let
inherit (nixpkgsFor."x86_64-linux".native) nixosTests;
in {
nix-serve =
assert nixosTests.nix-serve.config.nodes.machine.services.nix-serve.package.nix == self.packages.x86_64-linux.nix;
nixosTests.nix-serve;
})
Loading