diff --git a/flake.nix b/flake.nix index 89ab8e16..09a15f7e 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,7 @@ pkgs: pkgs.lib.makeScope pkgs.newScope (self: { inherit pkgs inputs; - craneLib = ((inputs.crane.mkLib pkgs).overrideToolchain (_: toolchain)); + craneLib = (inputs.crane.mkLib pkgs).overrideToolchain (_: toolchain); main = self.callPackage ./nix/pkgs/main { }; liburing = pkgs.liburing.overrideAttrs { # Tests weren't building @@ -58,7 +58,7 @@ (pkgs.rocksdb_9_10.override { # Override the liburing input for the build with our own so # we have it built with the library flag - liburing = self.liburing; + inherit (self) liburing; }).overrideAttrs (old: { src = inputs.rocksdb; @@ -218,9 +218,7 @@ { name = "${binaryName}-x86_64-haswell-optimised"; value = scopeCrossStatic.main.override { - x86_64_haswell_target_optimised = ( - if (crossSystem == "x86_64-linux-gnu" || crossSystem == "x86_64-linux-musl") then true else false - ); + x86_64_haswell_target_optimised = if (crossSystem == "x86_64-linux-gnu" || crossSystem == "x86_64-linux-musl") then true else false; }; } @@ -290,9 +288,7 @@ # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; - x86_64_haswell_target_optimised = ( - if (crossSystem == "x86_64-linux-gnu" || crossSystem == "x86_64-linux-musl") then true else false - ); + x86_64_haswell_target_optimised = if (crossSystem == "x86_64-linux-gnu" || crossSystem == "x86_64-linux-musl") then true else false; }; } diff --git a/nix/pkgs/main/cross-compilation-env.nix b/nix/pkgs/main/cross-compilation-env.nix index 2ee580a4..3e993bba 100644 --- a/nix/pkgs/main/cross-compilation-env.nix +++ b/nix/pkgs/main/cross-compilation-env.nix @@ -13,12 +13,7 @@ lib.optionalAttrs stdenv.hostPlatform.isStatic CARGO_BUILD_RUSTFLAGS = lib.concatStringsSep " " - ([ ] - # This disables PIE for static builds, which isn't great in terms - # of security. Unfortunately, my hand is forced because nixpkgs' - # `libstdc++.a` is built without `-fPIE`, which precludes us from - # leaving PIE enabled. - ++ lib.optionals + (lib.optionals stdenv.hostPlatform.isStatic [ "-C" "relocation-model=static" ] ++ lib.optionals diff --git a/nix/pkgs/main/default.nix b/nix/pkgs/main/default.nix index e7d15308..01fb8e40 100644 --- a/nix/pkgs/main/default.nix +++ b/nix/pkgs/main/default.nix @@ -93,16 +93,16 @@ let # for some reason enableLiburing in nixpkgs rocksdb is default true # which breaks Darwin entirely - enableLiburing = enableLiburing; + inherit enableLiburing; }).overrideAttrs (old: { - enableLiburing = enableLiburing; + inherit enableLiburing; cmakeFlags = (if x86_64_haswell_target_optimised then (lib.subtractLists [ # dont make a portable build if x86_64_haswell_target_optimised is enabled "-DPORTABLE=1" ] old.cmakeFlags - ++ [ "-DPORTABLE=haswell" ]) else ([ "-DPORTABLE=1" ]) + ++ [ "-DPORTABLE=haswell" ]) else [ "-DPORTABLE=1" ] ) ++ old.cmakeFlags;