Change indentation to 2 spaces in compileOptimized.Rust

This commit is contained in:
Ryze 2024-07-16 14:29:47 +03:00
parent 200a7d5c92
commit f1242d89aa
Signed by: ryze
GPG key ID: 9B296C5CEAEAAAC1

View file

@ -1,10 +1,10 @@
{ lib }: { lib }:
{ {
optimizationLevel ? "O3", optimizationLevel ? "O3",
enableLTO ? true, enableLTO ? true,
enableNativeOptimizations ? true, enableNativeOptimizations ? true,
additionalFlags ? [] additionalFlags ? []
}: }:
pkg: pkg:
@ -12,13 +12,13 @@ pkg:
assert builtins.elem optimizationLevel [ "O0" "O1" "O2" "O3" "Ofast" "Os" "Oz" "Og" ]; assert builtins.elem optimizationLevel [ "O0" "O1" "O2" "O3" "Ofast" "Os" "Oz" "Og" ];
let let
flags = [ "-${optimizationLevel}" ] flags = [ "-${optimizationLevel}" ]
++ lib.optional enableLTO "-flto" ++ lib.optional enableLTO "-flto"
++ lib.optional enableNativeOptimizations "-march=native" ++ lib.optional enableNativeOptimizations "-march=native"
++ additionalFlags; ++ additionalFlags;
in in
pkg.overrideAttrs (prevAttrs: { pkg.overrideAttrs (prevAttrs: {
env.NIX_CFLAGS_COMPILE = (prevAttrs.env.NIX_CFLAGS_COMPILE or "") env.NIX_CFLAGS_COMPILE = (prevAttrs.env.NIX_CFLAGS_COMPILE or "")
+ lib.strings.concatStringsSep " " flags; + lib.strings.concatStringsSep " " flags;
}) })