2019-04-08 15:28:05 +00:00
|
|
|
{
|
|
|
|
description = "The purely functional package manager";
|
|
|
|
|
2024-07-24 13:30:56 +00:00
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
2022-05-16 18:46:44 +00:00
|
|
|
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
|
2024-06-03 15:00:48 +00:00
|
|
|
inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446";
|
2023-03-06 19:51:58 +00:00
|
|
|
inputs.flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
2024-07-24 13:24:10 +00:00
|
|
|
inputs.libgit2 = { url = "github:libgit2/libgit2/v1.8.1"; flake = false; };
|
2019-04-08 15:28:05 +00:00
|
|
|
|
2024-04-18 19:59:39 +00:00
|
|
|
# dev tooling
|
|
|
|
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
|
2024-07-24 13:55:57 +00:00
|
|
|
inputs.git-hooks-nix.url = "github:cachix/git-hooks.nix";
|
2024-04-18 19:59:39 +00:00
|
|
|
# work around https://github.com/NixOS/nix/issues/7730
|
|
|
|
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
2024-07-24 13:55:57 +00:00
|
|
|
inputs.git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.git-hooks-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
|
2024-04-18 19:59:39 +00:00
|
|
|
# work around 7730 and https://github.com/NixOS/nix/issues/7807
|
2024-07-24 13:55:57 +00:00
|
|
|
inputs.git-hooks-nix.inputs.flake-compat.follows = "";
|
|
|
|
inputs.git-hooks-nix.inputs.gitignore.follows = "";
|
2024-04-18 19:59:39 +00:00
|
|
|
|
|
|
|
outputs = inputs@{ self, nixpkgs, nixpkgs-regression, libgit2, ... }:
|
|
|
|
|
2019-04-08 15:28:05 +00:00
|
|
|
|
2019-10-04 08:45:33 +00:00
|
|
|
let
|
2022-03-02 02:40:18 +00:00
|
|
|
inherit (nixpkgs) lib;
|
2023-12-02 17:25:47 +00:00
|
|
|
|
2022-12-06 17:00:10 +00:00
|
|
|
officialRelease = false;
|
|
|
|
|
2022-03-02 02:40:18 +00:00
|
|
|
version = lib.fileContents ./.version + versionSuffix;
|
2020-03-31 22:20:12 +00:00
|
|
|
versionSuffix =
|
|
|
|
if officialRelease
|
|
|
|
then ""
|
2020-10-21 19:31:19 +00:00
|
|
|
else "pre${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}_${self.shortRev or "dirty"}";
|
2020-03-13 17:28:01 +00:00
|
|
|
|
2023-08-23 18:28:24 +00:00
|
|
|
linux32BitSystems = [ "i686-linux" ];
|
2020-10-28 05:13:18 +00:00
|
|
|
linux64BitSystems = [ "x86_64-linux" "aarch64-linux" ];
|
2023-08-23 18:28:24 +00:00
|
|
|
linuxSystems = linux32BitSystems ++ linux64BitSystems;
|
|
|
|
darwinSystems = [ "x86_64-darwin" "aarch64-darwin" ];
|
|
|
|
systems = linuxSystems ++ darwinSystems;
|
2023-08-31 02:57:59 +00:00
|
|
|
|
|
|
|
crossSystems = [
|
2023-09-02 18:36:25 +00:00
|
|
|
"armv6l-unknown-linux-gnueabihf"
|
|
|
|
"armv7l-unknown-linux-gnueabihf"
|
2024-04-18 11:10:52 +00:00
|
|
|
"riscv64-unknown-linux-gnu"
|
2023-09-02 18:36:25 +00:00
|
|
|
"x86_64-unknown-netbsd"
|
2024-06-04 08:17:58 +00:00
|
|
|
"x86_64-unknown-freebsd"
|
2023-12-11 17:26:42 +00:00
|
|
|
"x86_64-w64-mingw32"
|
2023-08-31 02:57:59 +00:00
|
|
|
];
|
2021-02-06 00:07:48 +00:00
|
|
|
|
2023-11-30 22:48:44 +00:00
|
|
|
stdenvs = [
|
|
|
|
"ccacheStdenv"
|
|
|
|
"clangStdenv"
|
|
|
|
"gccStdenv"
|
|
|
|
"libcxxStdenv"
|
|
|
|
"stdenv"
|
|
|
|
];
|
2021-07-08 15:01:51 +00:00
|
|
|
|
2024-06-25 13:49:39 +00:00
|
|
|
/**
|
|
|
|
`flatMapAttrs attrs f` applies `f` to each attribute in `attrs` and
|
|
|
|
merges the results into a single attribute set.
|
|
|
|
|
|
|
|
This can be nested to form a build matrix where all the attributes
|
|
|
|
generated by the innermost `f` are returned as is.
|
|
|
|
(Provided that the names are unique.)
|
|
|
|
|
|
|
|
See https://nixos.org/manual/nixpkgs/stable/index.html#function-library-lib.attrsets.concatMapAttrs
|
|
|
|
*/
|
|
|
|
flatMapAttrs = attrs: f: lib.concatMapAttrs f attrs;
|
|
|
|
|
2022-03-02 02:40:18 +00:00
|
|
|
forAllSystems = lib.genAttrs systems;
|
|
|
|
|
|
|
|
forAllCrossSystems = lib.genAttrs crossSystems;
|
|
|
|
|
|
|
|
forAllStdenvs = f:
|
|
|
|
lib.listToAttrs
|
2021-07-08 15:01:51 +00:00
|
|
|
(map
|
2022-03-02 02:40:18 +00:00
|
|
|
(stdenvName: {
|
|
|
|
name = "${stdenvName}Packages";
|
|
|
|
value = f stdenvName;
|
|
|
|
})
|
|
|
|
stdenvs);
|
2021-07-08 15:01:51 +00:00
|
|
|
|
2024-04-18 19:59:39 +00:00
|
|
|
|
|
|
|
# We don't apply flake-parts to the whole flake so that non-development attributes
|
|
|
|
# load without fetching any development inputs.
|
|
|
|
devFlake = inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
imports = [ ./maintainers/flake-module.nix ];
|
|
|
|
systems = lib.subtractLists crossSystems systems;
|
|
|
|
perSystem = { system, ... }: {
|
|
|
|
_module.args.pkgs = nixpkgsFor.${system}.native;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-10-04 08:45:33 +00:00
|
|
|
# Memoize nixpkgs for different platforms for efficiency.
|
2022-03-02 02:40:18 +00:00
|
|
|
nixpkgsFor = forAllSystems
|
|
|
|
(system: let
|
|
|
|
make-pkgs = crossSystem: stdenv: import nixpkgs {
|
2023-08-31 02:57:59 +00:00
|
|
|
localSystem = {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
crossSystem = if crossSystem == null then null else {
|
2023-09-02 18:36:25 +00:00
|
|
|
config = crossSystem;
|
|
|
|
} // lib.optionalAttrs (crossSystem == "x86_64-unknown-freebsd13") {
|
2023-08-31 02:57:59 +00:00
|
|
|
useLLVM = true;
|
|
|
|
};
|
2022-03-02 02:40:18 +00:00
|
|
|
overlays = [
|
|
|
|
(overlayFor (p: p.${stdenv}))
|
|
|
|
];
|
|
|
|
};
|
|
|
|
stdenvs = forAllStdenvs (make-pkgs null);
|
|
|
|
native = stdenvs.stdenvPackages;
|
|
|
|
in {
|
|
|
|
inherit stdenvs native;
|
|
|
|
static = native.pkgsStatic;
|
2024-01-13 01:39:46 +00:00
|
|
|
cross = forAllCrossSystems (crossSystem: make-pkgs crossSystem "stdenv");
|
2022-03-02 02:40:18 +00:00
|
|
|
});
|
2019-10-04 08:45:33 +00:00
|
|
|
|
2023-12-03 23:16:07 +00:00
|
|
|
binaryTarball = nix: pkgs: pkgs.callPackage ./scripts/binary-tarball.nix {
|
2023-11-30 22:48:44 +00:00
|
|
|
inherit nix;
|
|
|
|
};
|
2021-06-26 05:12:03 +00:00
|
|
|
|
2021-07-08 15:01:51 +00:00
|
|
|
overlayFor = getStdenv: final: prev:
|
2023-11-30 22:48:44 +00:00
|
|
|
let
|
|
|
|
stdenv = getStdenv final;
|
|
|
|
in
|
2022-01-25 00:28:44 +00:00
|
|
|
{
|
|
|
|
nixStable = prev.nix;
|
2020-11-10 09:43:33 +00:00
|
|
|
|
2024-06-26 00:38:07 +00:00
|
|
|
# A new scope, so that we can use `callPackage` to inject our own interdependencies
|
|
|
|
# without "polluting" the top level "`pkgs`" attrset.
|
|
|
|
# This also has the benefit of providing us with a distinct set of packages
|
|
|
|
# we can iterate over.
|
2024-06-26 02:17:30 +00:00
|
|
|
nixComponents = lib.makeScope final.nixDependencies.newScope (import ./packaging/components.nix);
|
2023-12-03 23:47:54 +00:00
|
|
|
|
2024-06-26 01:58:47 +00:00
|
|
|
# The dependencies are in their own scope, so that they don't have to be
|
|
|
|
# in Nixpkgs top level `pkgs` or `nixComponents`.
|
2024-06-26 08:41:56 +00:00
|
|
|
nixDependencies = lib.makeScope final.newScope (import ./packaging/dependencies.nix {
|
|
|
|
inherit inputs stdenv versionSuffix;
|
|
|
|
pkgs = final;
|
2024-06-26 01:58:47 +00:00
|
|
|
});
|
|
|
|
|
2024-06-26 00:38:07 +00:00
|
|
|
nix = final.nixComponents.nix;
|
2023-02-06 15:36:57 +00:00
|
|
|
|
2024-06-16 10:22:42 +00:00
|
|
|
nix_noTests = final.nix.override {
|
|
|
|
doInstallCheck = false;
|
2024-07-27 11:42:03 +00:00
|
|
|
doCheck = false;
|
2024-06-16 10:22:42 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 11:52:56 +00:00
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/214409
|
|
|
|
# Remove when fixed in this flake's nixpkgs
|
2024-04-18 19:59:39 +00:00
|
|
|
pre-commit =
|
|
|
|
if prev.stdenv.hostPlatform.system == "i686-linux"
|
|
|
|
then (prev.pre-commit.override (o: { dotnet-sdk = ""; })).overridePythonAttrs (o: { doCheck = false; })
|
|
|
|
else prev.pre-commit;
|
|
|
|
|
2024-01-17 18:08:03 +00:00
|
|
|
};
|
|
|
|
|
2021-07-08 15:01:51 +00:00
|
|
|
in {
|
|
|
|
# A Nixpkgs overlay that overrides the 'nix' and
|
2024-06-04 22:10:25 +00:00
|
|
|
# 'nix-perl-bindings' packages.
|
2022-02-11 14:05:07 +00:00
|
|
|
overlays.default = overlayFor (p: p.stdenv);
|
2021-07-08 15:01:51 +00:00
|
|
|
|
2024-06-26 02:24:50 +00:00
|
|
|
hydraJobs = import ./packaging/hydra.nix {
|
2024-05-31 17:12:35 +00:00
|
|
|
inherit
|
|
|
|
inputs
|
|
|
|
binaryTarball
|
|
|
|
forAllCrossSystems
|
|
|
|
forAllSystems
|
|
|
|
lib
|
|
|
|
linux64BitSystems
|
|
|
|
nixpkgsFor
|
|
|
|
self
|
|
|
|
;
|
2024-05-31 22:27:20 +00:00
|
|
|
};
|
2021-10-15 10:36:29 +00:00
|
|
|
|
|
|
|
checks = forAllSystems (system: {
|
|
|
|
binaryTarball = self.hydraJobs.binaryTarball.${system};
|
|
|
|
installTests = self.hydraJobs.installTests.${system};
|
2023-01-17 23:17:59 +00:00
|
|
|
nixpkgsLibTests = self.hydraJobs.tests.nixpkgsLibTests.${system};
|
2023-12-09 18:55:47 +00:00
|
|
|
rl-next =
|
|
|
|
let pkgs = nixpkgsFor.${system}.native;
|
|
|
|
in pkgs.buildPackages.runCommand "test-rl-next-release-notes" { } ''
|
2024-06-03 16:38:38 +00:00
|
|
|
LANG=C.UTF-8 ${pkgs.changelog-d}/bin/changelog-d ${./doc/manual/rl-next} >$out
|
2023-12-09 18:55:47 +00:00
|
|
|
'';
|
2024-05-27 07:58:49 +00:00
|
|
|
repl-completion = nixpkgsFor.${system}.native.callPackage ./tests/repl-completion.nix { };
|
2022-03-02 02:40:18 +00:00
|
|
|
} // (lib.optionalAttrs (builtins.elem system linux64BitSystems)) {
|
2021-11-24 08:19:29 +00:00
|
|
|
dockerImage = self.hydraJobs.dockerImage.${system};
|
2024-03-07 09:40:53 +00:00
|
|
|
} // (lib.optionalAttrs (!(builtins.elem system linux32BitSystems))) {
|
|
|
|
# Some perl dependencies are broken on i686-linux.
|
|
|
|
# Since the support is only best-effort there, disable the perl
|
|
|
|
# bindings
|
2024-06-04 22:10:25 +00:00
|
|
|
|
|
|
|
# Temporarily disabled because GitHub Actions OOM issues. Once
|
|
|
|
# the old build system is gone and we are back to one build
|
|
|
|
# system, we should reenable this.
|
|
|
|
#perlBindings = self.hydraJobs.perlBindings.${system};
|
2024-06-25 13:35:47 +00:00
|
|
|
}
|
2024-06-25 13:49:39 +00:00
|
|
|
# Add "passthru" tests
|
2024-06-25 14:56:45 +00:00
|
|
|
// flatMapAttrs ({
|
2024-06-25 13:35:47 +00:00
|
|
|
"" = nixpkgsFor.${system}.native;
|
2024-06-25 14:56:45 +00:00
|
|
|
} // lib.optionalAttrs (! nixpkgsFor.${system}.native.stdenv.hostPlatform.isDarwin) {
|
|
|
|
# TODO: enable static builds for darwin, blocked on:
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/320448
|
|
|
|
"static-" = nixpkgsFor.${system}.static;
|
|
|
|
})
|
2024-06-27 21:28:31 +00:00
|
|
|
(nixpkgsPrefix: nixpkgs:
|
2024-06-26 00:38:07 +00:00
|
|
|
flatMapAttrs nixpkgs.nixComponents
|
2024-06-25 13:49:39 +00:00
|
|
|
(pkgName: pkg:
|
|
|
|
flatMapAttrs pkg.tests or {}
|
|
|
|
(testName: test: {
|
|
|
|
"${nixpkgsPrefix}${pkgName}-${testName}" = test;
|
|
|
|
})
|
|
|
|
)
|
|
|
|
)
|
2024-06-25 13:35:47 +00:00
|
|
|
// devFlake.checks.${system} or {}
|
2024-04-18 19:59:39 +00:00
|
|
|
);
|
2019-10-04 08:45:33 +00:00
|
|
|
|
2024-06-26 00:03:21 +00:00
|
|
|
packages = forAllSystems (system:
|
|
|
|
{ # Here we put attributes that map 1:1 into packages.<system>, ie
|
|
|
|
# for which we don't apply the full build matrix such as cross or static.
|
|
|
|
inherit (nixpkgsFor.${system}.native)
|
|
|
|
changelog-d;
|
|
|
|
default = self.packages.${system}.nix;
|
2024-06-26 08:47:13 +00:00
|
|
|
nix-internal-api-docs = nixpkgsFor.${system}.native.nixComponents.nix-internal-api-docs;
|
|
|
|
nix-external-api-docs = nixpkgsFor.${system}.native.nixComponents.nix-external-api-docs;
|
2024-06-04 13:28:27 +00:00
|
|
|
}
|
2024-06-26 00:03:21 +00:00
|
|
|
# We need to flatten recursive attribute sets of derivations to pass `flake check`.
|
|
|
|
// flatMapAttrs
|
|
|
|
{ # Components we'll iterate over in the upcoming lambda
|
|
|
|
"nix" = { };
|
|
|
|
# Temporarily disabled because GitHub Actions OOM issues. Once
|
|
|
|
# the old build system is gone and we are back to one build
|
|
|
|
# system, we should reenable these.
|
|
|
|
#"nix-util" = { };
|
|
|
|
#"nix-store" = { };
|
|
|
|
#"nix-fetchers" = { };
|
|
|
|
}
|
|
|
|
(pkgName: {}: {
|
|
|
|
# These attributes go right into `packages.<system>`.
|
2024-06-26 00:44:21 +00:00
|
|
|
"${pkgName}" = nixpkgsFor.${system}.native.nixComponents.${pkgName};
|
|
|
|
"${pkgName}-static" = nixpkgsFor.${system}.static.nixComponents.${pkgName};
|
2024-06-26 00:03:21 +00:00
|
|
|
}
|
|
|
|
// flatMapAttrs (lib.genAttrs crossSystems (_: { })) (crossSystem: {}: {
|
|
|
|
# These attributes go right into `packages.<system>`.
|
2024-06-26 00:44:21 +00:00
|
|
|
"${pkgName}-${crossSystem}" = nixpkgsFor.${system}.cross.${crossSystem}.nixComponents.${pkgName};
|
2024-06-26 00:03:21 +00:00
|
|
|
})
|
|
|
|
// flatMapAttrs (lib.genAttrs stdenvs (_: { })) (stdenvName: {}: {
|
|
|
|
# These attributes go right into `packages.<system>`.
|
2024-06-26 00:44:21 +00:00
|
|
|
"${pkgName}-${stdenvName}" = nixpkgsFor.${system}.stdenvs."${stdenvName}Packages".nixComponents.${pkgName};
|
2024-06-26 00:03:21 +00:00
|
|
|
})
|
|
|
|
)
|
2024-06-04 13:28:27 +00:00
|
|
|
// lib.optionalAttrs (builtins.elem system linux64BitSystems) {
|
2022-01-26 13:31:23 +00:00
|
|
|
dockerImage =
|
|
|
|
let
|
2022-03-02 02:40:18 +00:00
|
|
|
pkgs = nixpkgsFor.${system}.native;
|
2022-01-26 13:31:23 +00:00
|
|
|
image = import ./docker.nix { inherit pkgs; tag = version; };
|
|
|
|
in
|
|
|
|
pkgs.runCommand
|
|
|
|
"docker-image-tarball-${version}"
|
|
|
|
{ meta.description = "Docker image with Nix for ${system}"; }
|
|
|
|
''
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
image=$out/image.tar.gz
|
|
|
|
ln -s ${image} $image
|
|
|
|
echo "file binary-dist $image" >> $out/nix-support/hydra-build-products
|
|
|
|
'';
|
2024-06-04 13:28:27 +00:00
|
|
|
});
|
2022-03-02 02:40:18 +00:00
|
|
|
|
|
|
|
devShells = let
|
2024-04-18 19:59:39 +00:00
|
|
|
makeShell = pkgs: stdenv: (pkgs.nix.override { inherit stdenv; forDevShell = true; }).overrideAttrs (attrs:
|
|
|
|
let
|
|
|
|
modular = devFlake.getSystem stdenv.buildPlatform.system;
|
2024-06-04 22:10:25 +00:00
|
|
|
transformFlag = prefix: flag:
|
|
|
|
assert builtins.isString flag;
|
|
|
|
let
|
|
|
|
rest = builtins.substring 2 (builtins.stringLength flag) flag;
|
|
|
|
in
|
|
|
|
"-D${prefix}:${rest}";
|
|
|
|
havePerl = stdenv.buildPlatform == stdenv.hostPlatform && stdenv.hostPlatform.isUnix;
|
2024-07-21 22:03:04 +00:00
|
|
|
ignoreCrossFile = flags: builtins.filter (flag: !(lib.strings.hasInfix "cross-file" flag)) flags;
|
2024-04-18 19:59:39 +00:00
|
|
|
in {
|
2024-04-18 21:32:31 +00:00
|
|
|
pname = "shell-for-" + attrs.pname;
|
2024-06-04 13:28:27 +00:00
|
|
|
|
|
|
|
# Remove the version suffix to avoid unnecessary attempts to substitute in nix develop
|
|
|
|
version = lib.fileContents ./.version;
|
|
|
|
name = attrs.pname;
|
|
|
|
|
2023-12-01 11:25:22 +00:00
|
|
|
installFlags = "sysconfdir=$(out)/etc";
|
|
|
|
shellHook = ''
|
|
|
|
PATH=$prefix/bin:$PATH
|
|
|
|
unset PYTHONPATH
|
|
|
|
export MANPATH=$out/share/man:$MANPATH
|
|
|
|
|
|
|
|
# Make bash completion work.
|
|
|
|
XDG_DATA_DIRS+=:$out/share
|
|
|
|
'';
|
2024-02-28 07:02:49 +00:00
|
|
|
|
2024-04-18 21:45:00 +00:00
|
|
|
# We use this shell with the local checkout, not unpackPhase.
|
|
|
|
src = null;
|
|
|
|
|
2024-04-18 19:59:39 +00:00
|
|
|
env = {
|
2024-06-04 13:28:27 +00:00
|
|
|
# Needed for Meson to find Boost.
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/86131.
|
2024-06-27 21:28:31 +00:00
|
|
|
BOOST_INCLUDEDIR = "${lib.getDev pkgs.nixDependencies.boost}/include";
|
|
|
|
BOOST_LIBRARYDIR = "${lib.getLib pkgs.nixDependencies.boost}/lib";
|
2024-04-18 19:59:39 +00:00
|
|
|
# For `make format`, to work without installing pre-commit
|
|
|
|
_NIX_PRE_COMMIT_HOOKS_CONFIG =
|
|
|
|
"${(pkgs.formats.yaml { }).generate "pre-commit-config.yaml" modular.pre-commit.settings.rawConfig}";
|
|
|
|
};
|
|
|
|
|
2024-06-04 22:10:25 +00:00
|
|
|
mesonFlags =
|
2024-07-21 22:03:04 +00:00
|
|
|
map (transformFlag "libutil") (ignoreCrossFile pkgs.nixComponents.nix-util.mesonFlags)
|
|
|
|
++ map (transformFlag "libstore") (ignoreCrossFile pkgs.nixComponents.nix-store.mesonFlags)
|
|
|
|
++ map (transformFlag "libfetchers") (ignoreCrossFile pkgs.nixComponents.nix-fetchers.mesonFlags)
|
|
|
|
++ lib.optionals havePerl (map (transformFlag "perl") (ignoreCrossFile pkgs.nixComponents.nix-perl-bindings.mesonFlags))
|
|
|
|
++ map (transformFlag "libexpr") (ignoreCrossFile pkgs.nixComponents.nix-expr.mesonFlags)
|
|
|
|
++ map (transformFlag "libcmd") (ignoreCrossFile pkgs.nixComponents.nix-cmd.mesonFlags)
|
2024-06-04 22:10:25 +00:00
|
|
|
;
|
2024-06-04 13:28:27 +00:00
|
|
|
|
2023-12-15 11:41:38 +00:00
|
|
|
nativeBuildInputs = attrs.nativeBuildInputs or []
|
2024-06-26 00:44:21 +00:00
|
|
|
++ pkgs.nixComponents.nix-util.nativeBuildInputs
|
|
|
|
++ pkgs.nixComponents.nix-store.nativeBuildInputs
|
|
|
|
++ pkgs.nixComponents.nix-fetchers.nativeBuildInputs
|
|
|
|
++ lib.optionals havePerl pkgs.nixComponents.nix-perl-bindings.nativeBuildInputs
|
2024-06-26 08:47:13 +00:00
|
|
|
++ pkgs.nixComponents.nix-internal-api-docs.nativeBuildInputs
|
|
|
|
++ pkgs.nixComponents.nix-external-api-docs.nativeBuildInputs
|
2024-07-21 22:03:04 +00:00
|
|
|
++ lib.optional
|
|
|
|
(!stdenv.buildPlatform.canExecute stdenv.hostPlatform
|
|
|
|
# Hack around https://github.com/nixos/nixpkgs/commit/bf7ad8cfbfa102a90463433e2c5027573b462479
|
|
|
|
&& !(stdenv.hostPlatform.isWindows && stdenv.buildPlatform.isDarwin)
|
|
|
|
&& stdenv.hostPlatform.emulatorAvailable pkgs.buildPackages
|
|
|
|
&& lib.meta.availableOn stdenv.buildPlatform (stdenv.hostPlatform.emulator pkgs.buildPackages))
|
|
|
|
pkgs.buildPackages.mesonEmulatorHook
|
2024-04-18 19:59:39 +00:00
|
|
|
++ [
|
2024-06-27 23:19:32 +00:00
|
|
|
pkgs.buildPackages.cmake
|
2024-07-21 22:03:04 +00:00
|
|
|
pkgs.buildPackages.shellcheck
|
2024-04-18 19:59:39 +00:00
|
|
|
modular.pre-commit.settings.package
|
|
|
|
(pkgs.writeScriptBin "pre-commit-hooks-install"
|
|
|
|
modular.pre-commit.settings.installationScript)
|
|
|
|
]
|
2024-02-27 12:45:18 +00:00
|
|
|
# TODO: Remove the darwin check once
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/291814 is available
|
2024-02-27 17:45:51 +00:00
|
|
|
++ lib.optional (stdenv.cc.isClang && !stdenv.buildPlatform.isDarwin) pkgs.buildPackages.bear
|
2023-12-15 11:41:38 +00:00
|
|
|
++ lib.optional (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) pkgs.buildPackages.clang-tools;
|
2024-06-04 22:10:25 +00:00
|
|
|
|
|
|
|
buildInputs = attrs.buildInputs or []
|
2024-06-27 22:09:32 +00:00
|
|
|
++ [
|
|
|
|
pkgs.gtest
|
|
|
|
pkgs.rapidcheck
|
|
|
|
]
|
2024-06-04 22:10:25 +00:00
|
|
|
++ lib.optional havePerl pkgs.perl
|
|
|
|
;
|
2023-12-01 11:25:22 +00:00
|
|
|
});
|
2022-03-02 02:40:18 +00:00
|
|
|
in
|
|
|
|
forAllSystems (system:
|
|
|
|
let
|
|
|
|
makeShells = prefix: pkgs:
|
|
|
|
lib.mapAttrs'
|
|
|
|
(k: v: lib.nameValuePair "${prefix}-${k}" v)
|
|
|
|
(forAllStdenvs (stdenvName: makeShell pkgs pkgs.${stdenvName}));
|
|
|
|
in
|
|
|
|
(makeShells "native" nixpkgsFor.${system}.native) //
|
2024-02-27 18:24:31 +00:00
|
|
|
(lib.optionalAttrs (!nixpkgsFor.${system}.native.stdenv.isDarwin)
|
2024-01-13 01:39:46 +00:00
|
|
|
(makeShells "static" nixpkgsFor.${system}.static) //
|
|
|
|
(forAllCrossSystems (crossSystem: let pkgs = nixpkgsFor.${system}.cross.${crossSystem}; in makeShell pkgs pkgs.stdenv))) //
|
2022-03-02 02:40:18 +00:00
|
|
|
{
|
|
|
|
default = self.devShells.${system}.native-stdenvPackages;
|
|
|
|
}
|
|
|
|
);
|
2019-04-08 15:28:05 +00:00
|
|
|
};
|
|
|
|
}
|