Skip to content

Commit 43c524d

Browse files
authored
Merge pull request #82 from NixOS/nix-2.28
Nix 2.28 + format
2 parents 6dc6c21 + 8263fae commit 43c524d

File tree

4 files changed

+71
-55
lines changed

4 files changed

+71
-55
lines changed

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
1+
(import (fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz") {
22
src = builtins.fetchGit ./.;
33
}).defaultNix

flake.nix

Lines changed: 61 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,57 @@
33

44
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
55

6-
outputs = { self, nixpkgs }:
6+
outputs =
7+
{ self, nixpkgs }:
78
{
89
overlays.default = final: prev: {
9-
nixos-channel-native-programs = with final; stdenv.mkDerivation {
10+
nixos-channel-native-programs = final.stdenv.mkDerivation {
1011
name = "nixos-channel-native-programs";
11-
buildInputs = [
12-
nix
13-
pkg-config
14-
boehmgc
15-
nlohmann_json
16-
boost
17-
sqlite
12+
13+
strictDeps = true;
14+
15+
nativeBuildInputs = with final.buildPackages; [
16+
pkg-config
1817
];
1918

20-
buildCommand = let
21-
nixHasSignalsHh = nixpkgs.lib.strings.versionAtLeast nix.version "2.19";
22-
in ''
19+
buildInputs = with final; [
20+
nixVersions.nix_2_28
21+
nlohmann_json
22+
boost
23+
];
24+
25+
buildCommand = ''
2326
mkdir -p $out/bin
2427
25-
g++ -Os -g ${./index-debuginfo.cc} -Wall -std=c++14 -o $out/bin/index-debuginfo -I . \
26-
$(pkg-config --cflags nix-main) \
27-
$(pkg-config --libs nix-main) \
28-
$(pkg-config --libs nix-store) \
29-
-lsqlite3 \
30-
${nixpkgs.lib.optionalString nixHasSignalsHh "-DHAS_SIGNALS_HH"}
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
3136
'';
3237
};
3338

34-
nixos-channel-scripts = with final; stdenv.mkDerivation {
39+
nixos-channel-scripts = final.stdenv.mkDerivation {
3540
name = "nixos-channel-scripts";
3641

37-
buildInputs = with perlPackages;
38-
[ nix
39-
sqlite
40-
makeWrapper
41-
perl
42-
FileSlurp
43-
LWP
44-
LWPProtocolHttps
45-
ListMoreUtils
46-
DBDSQLite
47-
NetAmazonS3
48-
brotli
49-
jq
50-
nixos-channel-native-programs
51-
nix-index
52-
];
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+
];
5357

5458
buildCommand = ''
5559
mkdir -p $out/bin
@@ -58,19 +62,35 @@
5862
wrapProgram $out/bin/mirror-nixos-branch \
5963
--set PERL5LIB $PERL5LIB \
6064
--set XZ_OPT "-T0" \
61-
--prefix PATH : ${lib.makeBinPath [ wget git nix gnutar xz rsync openssh nix-index nixos-channel-native-programs ]}
65+
--prefix PATH : ${
66+
final.lib.makeBinPath (
67+
with final;
68+
[
69+
wget
70+
git
71+
nix
72+
gnutar
73+
xz
74+
rsync
75+
openssh
76+
nix-index
77+
nixos-channel-native-programs
78+
]
79+
)
80+
}
6281
6382
patchShebangs $out/bin
6483
'';
6584
};
6685

6786
};
6887

69-
packages.default.x86_64-linux = (import nixpkgs {
70-
system = "x86_64-linux";
71-
overlays = [ self.overlays.default ];
72-
}).nixos-channel-scripts;
88+
packages.x86_64-linux.default =
89+
(import nixpkgs {
90+
system = "x86_64-linux";
91+
overlays = [ self.overlays.default ];
92+
}).nixos-channel-scripts;
7393

74-
checks.x86_64-linux.default = self.packages.default.x86_64-linux;
94+
checks.x86_64-linux.default = self.packages.x86_64-linux.default;
7595
};
7696
}

index-debuginfo.cc

Lines changed: 8 additions & 12 deletions
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

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
1+
(import (fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz") {
22
src = builtins.fetchGit ./.;
33
}).shellNix

0 commit comments

Comments
 (0)