Skip to content

Commit 8263fae

Browse files
Ericson2314Mic92
authored andcommitted
Fix build with Nix 2.28, improve packaging in other ways
1 parent 3462200 commit 8263fae

File tree

2 files changed

+74
-78
lines changed

2 files changed

+74
-78
lines changed

flake.nix

+66-66
Original file line numberDiff line numberDiff line change
@@ -7,66 +7,65 @@
77
{ self, nixpkgs }:
88
{
99
overlays.default = final: prev: {
10-
nixos-channel-native-programs =
11-
with final;
12-
stdenv.mkDerivation {
13-
name = "nixos-channel-native-programs";
14-
buildInputs = [
15-
nix
16-
pkg-config
17-
boehmgc
18-
nlohmann_json
19-
boost
20-
sqlite
21-
];
22-
23-
buildCommand =
24-
let
25-
nixHasSignalsHh = nixpkgs.lib.strings.versionAtLeast nix.version "2.19";
26-
in
27-
''
28-
mkdir -p $out/bin
29-
30-
g++ -Os -g ${./index-debuginfo.cc} -Wall -std=c++14 -o $out/bin/index-debuginfo -I . \
31-
$(pkg-config --cflags nix-main) \
32-
$(pkg-config --libs nix-main) \
33-
$(pkg-config --libs nix-store) \
34-
-lsqlite3 \
35-
${nixpkgs.lib.optionalString nixHasSignalsHh "-DHAS_SIGNALS_HH"}
36-
'';
37-
};
38-
39-
nixos-channel-scripts =
40-
with final;
41-
stdenv.mkDerivation {
42-
name = "nixos-channel-scripts";
43-
44-
buildInputs = with perlPackages; [
45-
nix
46-
sqlite
47-
makeWrapper
48-
perl
49-
FileSlurp
50-
LWP
51-
LWPProtocolHttps
52-
ListMoreUtils
53-
DBDSQLite
54-
NetAmazonS3
55-
brotli
56-
jq
57-
nixos-channel-native-programs
58-
nix-index
59-
];
60-
61-
buildCommand = ''
62-
mkdir -p $out/bin
63-
64-
cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch
65-
wrapProgram $out/bin/mirror-nixos-branch \
66-
--set PERL5LIB $PERL5LIB \
67-
--set XZ_OPT "-T0" \
68-
--prefix PATH : ${
69-
lib.makeBinPath [
10+
nixos-channel-native-programs = final.stdenv.mkDerivation {
11+
name = "nixos-channel-native-programs";
12+
13+
strictDeps = true;
14+
15+
nativeBuildInputs = with final.buildPackages; [
16+
pkg-config
17+
];
18+
19+
buildInputs = with final; [
20+
nixVersions.nix_2_28
21+
nlohmann_json
22+
boost
23+
];
24+
25+
buildCommand = ''
26+
mkdir -p $out/bin
27+
28+
$CXX \
29+
-Os -g -Wall \
30+
-std=c++14 \
31+
$(pkg-config --libs --cflags nix-store) \
32+
$(pkg-config --libs --cflags nix-main) \
33+
-I . \
34+
${./index-debuginfo.cc} \
35+
-o $out/bin/index-debuginfo
36+
'';
37+
};
38+
39+
nixos-channel-scripts = final.stdenv.mkDerivation {
40+
name = "nixos-channel-scripts";
41+
42+
strictDeps = true;
43+
44+
nativeBuildInputs = with final.buildPackages; [
45+
makeWrapper
46+
];
47+
48+
buildInputs = with final.perlPackages; [
49+
final.perl
50+
FileSlurp
51+
LWP
52+
LWPProtocolHttps
53+
ListMoreUtils
54+
DBDSQLite
55+
NetAmazonS3
56+
];
57+
58+
buildCommand = ''
59+
mkdir -p $out/bin
60+
61+
cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch
62+
wrapProgram $out/bin/mirror-nixos-branch \
63+
--set PERL5LIB $PERL5LIB \
64+
--set XZ_OPT "-T0" \
65+
--prefix PATH : ${
66+
final.lib.makeBinPath (
67+
with final;
68+
[
7069
wget
7170
git
7271
nix
@@ -77,20 +76,21 @@
7776
nix-index
7877
nixos-channel-native-programs
7978
]
80-
}
79+
)
80+
}
8181
82-
patchShebangs $out/bin
83-
'';
84-
};
82+
patchShebangs $out/bin
83+
'';
84+
};
8585

8686
};
8787

88-
packages.default.x86_64-linux =
88+
packages.x86_64-linux.default =
8989
(import nixpkgs {
9090
system = "x86_64-linux";
9191
overlays = [ self.overlays.default ];
9292
}).nixos-channel-scripts;
9393

94-
checks.x86_64-linux.default = self.packages.default.x86_64-linux;
94+
checks.x86_64-linux.default = self.packages.x86_64-linux.default;
9595
};
9696
}

index-debuginfo.cc

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
#include <nix/config.h>
2-
31
#include <regex>
42

5-
#include "shared.hh"
6-
#include "sqlite.hh"
7-
#include "s3-binary-cache-store.hh"
8-
#include "thread-pool.hh"
9-
#include "nar-info.hh"
3+
#include <nlohmann/json.hpp>
4+
5+
#include <nix/util/signals.hh>
6+
#include <nix/util/thread-pool.hh>
107

11-
// https://github.com/NixOS/nix/commit/ac89bb064aeea85a62b82a6daf0ecca7190a28b7
12-
#ifdef HAS_SIGNALS_HH
13-
#include "signals.hh"
14-
#endif
8+
#include <nix/store/nar-info.hh>
9+
#include <nix/store/s3-binary-cache-store.hh>
10+
#include <nix/store/sqlite.hh>
1511

16-
#include <nlohmann/json.hpp>
12+
#include <nix/main/shared.hh>
1713

1814
// cache.nixos.org/debuginfo/<build-id>
1915
// => redirect to NAR

0 commit comments

Comments
 (0)