From 14d793b47ef198a55be91b0128a1a24935313018 Mon Sep 17 00:00:00 2001 From: chn Date: Wed, 14 Jun 2023 00:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=20hostPlatform=20=E4=BC=9A?= =?UTF-8?q?=E8=B5=B7=E4=BD=9C=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/flake.nix b/flake.nix index 90971fd7..0e656244 100644 --- a/flake.nix +++ b/flake.nix @@ -120,6 +120,32 @@ ./modules/virtualisation/waydroid.nix ./modules/home/root.nix ./modules/home/chn.nix + + ({ pkgs, ...}@inputs: + { + config.environment.systemPackages = + [ + ( inputs.inputs.nixpkgs.lib.nixosSystem + { + system = "x86_64-linux"; + modules = [({ pkgs, ... }@inputs: + { + config.nixpkgs = + { + hostPlatform = + { system = "x86_64-linux"; gcc = { arch = "alderlake"; tune = "alderlake"; }; }; + config.allowUnfree = true; + }; + config.nixpkgs.overlays = [( final: prev: rec + { + optimizeWithFlags = pkg: flags: pkg.overrideAttrs (old: + { NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags; }); + hello = optimizeWithFlags prev.hello [ "-frecord-gcc-switches" ]; + } )]; + })]; + } ).pkgs.hello + ]; + }) ]; };