Optimize for each system individually #168

Closed
DarkKirb wants to merge 10 commits from per-system-optim into main
2 changed files with 7 additions and 27 deletions
Showing only changes of commit c788c898c8 - Show all commits

View file

@ -1,15 +1,12 @@
# Configuration file configuring specialization
{
pkgs,
config,
lib,
...
}: {
nixpkgs.overlays = [
(self: prev: {
})
];
{config, ...}: {
environment.etc."nix/local-system.json".text = builtins.toJSON {
inherit (config.nixpkgs.localSystem) system gcc rustc linux-kernel;
};
# Instead of overriding stdenv, we provide a user hook that appends the correct configure flags
nixpkgs.config.stdenv.userHook = ''
NIX_CFLAGS_COMPILE+="-O3 -pipe -flto"
unset doCheck doInstallCheck
'';
}

View file

@ -95,23 +95,6 @@ index bf410ec0..10b240b7 100644
vanillaPackages.stdenv.override { targetPlatform = crossSystem; };
# It's OK to change the built-time dependencies
allowCustomOverrides = true;
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 6cb494d46e5..f53cfde3bad 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -165,10 +165,8 @@ let
, ... } @ attrs:
let
- # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when
- # no package has `doCheck = true`.
- doCheck' = doCheck && stdenv.buildPlatform.canExecute stdenv.hostPlatform;
- doInstallCheck' = doInstallCheck && stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+ doCheck' = config.doCheckByDefault && stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+ doInstallCheck' = config.doCheckByDefault && stdenv.buildPlatform.canExecute stdenv.hostPlatform;
separateDebugInfo' = separateDebugInfo && stdenv.hostPlatform.isLinux;
outputs' = outputs ++ lib.optional separateDebugInfo' "debug";
diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix
index 4d847e280f4..874b776c1e1 100644
--- a/pkgs/top-level/impure.nix