-
Notifications
You must be signed in to change notification settings - Fork 163
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,14 @@ let | |
overlay = | ||
self: pkgs: | ||
let | ||
inherit (pkgs) lib; | ||
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) // { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
inherit (pkgs) pre-commit; | ||
}; | ||
checks = self.packages // { | ||
|
@@ -27,7 +28,7 @@ let | |
}; | ||
all-tools-eval = | ||
let | ||
config = pkgs.lib.evalModules { | ||
config = lib.evalModules { | ||
modules = [ | ||
../modules/all-modules.nix | ||
{ | ||
|
@@ -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)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't coerce |
||
(lib.mapAttrsToList (_: value: value.entry)) | ||
]; | ||
in | ||
pkgs.runCommand "all-tools-eval" | ||
{ | ||
|
@@ -47,7 +51,6 @@ let | |
''; | ||
doc-check = | ||
let | ||
inherit (pkgs) lib; | ||
# We might add that it keeps rendering fast and robust, | ||
# and we want to teach `defaultText` which is more broadly applicable, | ||
# but the message is long enough. | ||
|
@@ -64,7 +67,7 @@ let | |
If necessary, you can also find the offending option by evaluating with `--show-trace` and then look for occurrences of `option`. | ||
''; | ||
pkgsStub = lib.mapAttrs failPkgAttr pkgs; | ||
configuration = pkgs.lib.evalModules { | ||
configuration = lib.evalModules { | ||
modules = [ | ||
../modules/all-modules.nix | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
{ stdenv, lib, headache ? null, ocamlPackages }: | ||
{ stdenv, lib, darwin, headache ? null, ocamlPackages }: | ||
|
||
## NOTE: `headache` moved from `ocamlPackages.headache` to top-level on 8 June | ||
## 2023. Once this gets into a NixOS release, the following code will be | ||
## useless. | ||
let the-headache = if headache != null then headache else ocamlPackages.headache; in | ||
let | ||
the-headache = | ||
(if headache != null then headache else ocamlPackages.headache).overrideAttrs (drv: { | ||
nativeBuildInputs = (drv.nativeBuildInputs or [ ]) ++ lib.optionals stdenv.isDarwin [ | ||
darwin.sigtool | ||
]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
}); | ||
in | ||
|
||
## NOTE: The following derivation seems rather trivial, but it is used here to | ||
## get rid of a runtime dependency in the whole OCaml compiler (~420M). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ stdenv | ||
, lib | ||
|
||
, actionlint | ||
, alejandra | ||
|
@@ -26,18 +27,14 @@ | |
, elixir | ||
, elmPackages | ||
, fprettify | ||
, git | ||
, git-annex | ||
, gitAndTools | ||
, gptcommit ? null | ||
, hadolint | ||
, haskell | ||
, haskellPackages | ||
, hindent | ||
, hlint | ||
, hpack | ||
, html-tidy | ||
, hunspell | ||
, luaPackages | ||
, lua-language-server | ||
, lychee | ||
|
@@ -57,7 +54,6 @@ | |
, php82Packages | ||
, ripsecrets ? null | ||
, ruff ? null | ||
, runCommand | ||
, rustfmt | ||
, shellcheck | ||
, bats | ||
|
@@ -69,15 +65,12 @@ | |
, tagref | ||
, taplo | ||
, texlive | ||
, tflint | ||
, topiary ? null ## Added in nixpkgs on Dec 2, 2022 | ||
, treefmt | ||
, typos | ||
, typstfmt | ||
, zprint | ||
, yamllint | ||
, writeScript | ||
, writeText | ||
, go | ||
, go-tools | ||
, golangci-lint | ||
|
@@ -115,7 +108,6 @@ in | |
editorconfig-checker | ||
elixir | ||
fprettify | ||
git-annex | ||
go | ||
go-tools | ||
golangci-lint | ||
|
@@ -132,7 +124,6 @@ in | |
nil | ||
nixfmt | ||
nixpkgs-fmt | ||
opam | ||
ormolu | ||
pre-commit-hook-ensure-sops | ||
revive | ||
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting these to |
||
# Note: Only broken in stable nixpkgs, works fine on latest master. | ||
opam = if stdenv.isDarwin then null else opam; | ||
|
||
## NOTE: `checkmake` 0.2.2 landed in nixpkgs on 12 April 2023. Once this gets | ||
## into a NixOS release, the following code will be useless. | ||
|
There was a problem hiding this comment.
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 wherenix flake check
would fail but building the corresponding package withnix build .#opam
would succeed.