Skip to content

Commit d8e2a0d

Browse files
committed
fix: rebase with develop
1 parent 6c9121a commit d8e2a0d

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

nix/kms-server.nix

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,29 @@ let
2323
# - fips.darwin.sha256 | fips.linux.sha256 (fallback by OS)
2424
# - fips.sha256 (global fallback, typically Linux)
2525
# Same naming for non-fips.* files.
26-
expectedHashFile = base: let
27-
sys = pkgs.stdenv.hostPlatform.system;
28-
dir = toString ./expected-hashes;
29-
candidates = lib.filter (s: s != null) [
30-
"${dir}/${base}.${sys}.sha256"
31-
(if pkgs.stdenv.isDarwin then "${dir}/${base}.darwin.sha256" else null)
32-
(if pkgs.stdenv.isLinux then "${dir}/${base}.linux.sha256" else null)
33-
];
34-
firstExisting = lib.findFirst (p: builtins.pathExists (builtins.toPath p)) null candidates;
35-
finalPath = if firstExisting != null then firstExisting else "${dir}/${base}.sha256";
36-
in builtins.readFile (builtins.toPath finalPath);
26+
expectedHashFile =
27+
base:
28+
let
29+
sys = pkgs.stdenv.hostPlatform.system;
30+
dir = toString ./expected-hashes;
31+
candidates = lib.filter (s: s != null) [
32+
"${dir}/${base}.${sys}.sha256"
33+
(if pkgs.stdenv.isDarwin then "${dir}/${base}.darwin.sha256" else null)
34+
(if pkgs.stdenv.isLinux then "${dir}/${base}.linux.sha256" else null)
35+
];
36+
firstExisting = lib.findFirst (p: builtins.pathExists (builtins.toPath p)) null candidates;
37+
finalPath = if firstExisting != null then firstExisting else "${dir}/${base}.sha256";
38+
in
39+
builtins.readFile (builtins.toPath finalPath);
3740

3841
expectedHashFipsRaw = expectedHashFile "fips";
3942
expectedHashNonFipsRaw = expectedHashFile "non-fips";
40-
sanitizeHash = s: let noWS = lib.replaceStrings ["\n" "\r" " " "\t"] ["" "" "" ""] s; in lib.strings.removeSuffix "\n" noWS;
43+
sanitizeHash =
44+
s:
45+
let
46+
noWS = lib.replaceStrings [ "\n" "\r" " " "\t" ] [ "" "" "" "" ] s;
47+
in
48+
lib.strings.removeSuffix "\n" noWS;
4149
expectedHashFips = sanitizeHash expectedHashFipsRaw;
4250
expectedHashNonFips = sanitizeHash expectedHashNonFipsRaw;
4351
expectedHash = if isFips then expectedHashFips else expectedHashNonFips;
@@ -162,14 +170,15 @@ rustPlatform.buildRustPackage rec {
162170
# - Single codegen unit for stable ordering
163171
# - Disable linker build-id which otherwise embeds a random-ish identifier
164172
# - Keep our dynamic linker override handled in buildPhase (per-arch)
165-
RUSTFLAGS = lib.optionalString pkgs.stdenv.isLinux
166-
(lib.concatStringsSep " " [
173+
RUSTFLAGS = lib.optionalString pkgs.stdenv.isLinux (
174+
lib.concatStringsSep " " [
167175
"-Cdebuginfo=0"
168176
"-Ccodegen-units=1"
169177
"-Cincremental=false"
170178
# "-Clto=off"
171179
"-C link-arg=-Wl,--build-id=none"
172-
]);
180+
]
181+
);
173182

174183
# Prevent Nix from injecting RPATHs to /nix/store into the resulting binary.
175184
# This ensures the packaged binary will not try to load glibc from the store

0 commit comments

Comments
 (0)