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

Fix nix flake check on macOS #421

Merged
merged 1 commit into from
Mar 30, 2024
Merged

Conversation

9999years
Copy link
Contributor

This fixes nix flake check on macOS.

Comment on lines +51 to +53
(exposed.checks
// (lib.mapAttrs' (name: value: lib.nameValuePair "stable-${name}" value)
exposed-stable.checks));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two sets had the same names, so only the checks from the second set (exposed-stable) were being built. This led to a confusing situation where nix flake check would fail but building the corresponding package with nix build .#opam would succeed.

tools = import ./call-tools.nix pkgs;
run = pkgs.callPackage ./run.nix { inherit pkgs tools isFlakes gitignore-nix-src; };
in
{
inherit tools run;
# Flake style attributes
packages = tools // {
packages = (lib.filterAttrs (_name: value: value != null) tools) // {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nix flake check complains if non-derivation values are present in packages.

@@ -37,7 +38,10 @@ let
specialArgs = { inherit pkgs; };
};
allHooks = config.config.hooks;
allEntryPoints = pkgs.lib.mapAttrsToList (_: v: v.entry) allHooks;
allEntryPoints = lib.pipe allHooks [
(lib.filterAttrs (_name: value: value.package != null))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't coerce null to a string.

the-headache =
(if headache != null then headache else ocamlPackages.headache).overrideAttrs (drv: {
nativeBuildInputs = (drv.nativeBuildInputs or [ ]) ++ lib.optionals stdenv.isDarwin [
darwin.sigtool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missing codesign on nixpkgs-stable.

@@ -183,6 +174,9 @@ in
chktex = tex;
commitizen = commitizen.overrideAttrs (_: _: { doCheck = false; });
bats = if bats ? withLibraries then (bats.withLibraries (p: [ p.bats-support p.bats-assert p.bats-file ])) else bats;
git-annex = if stdenv.isDarwin then null else git-annex;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting these to null is kinda sketchy (meta.broken would be better) but it's what the other derivations in this file do so I left it as-is.

@domenkozar domenkozar merged commit 200fbd4 into cachix:master Mar 30, 2024
2 of 4 checks passed
@9999years 9999years deleted the fix-macos branch April 12, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants