-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathflake.nix
96 lines (79 loc) · 2.39 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
description = "Script for generating Nixpkgs/NixOS channels";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
outputs =
{ self, nixpkgs }:
{
overlays.default = final: prev: {
nixos-channel-native-programs = final.stdenv.mkDerivation {
name = "nixos-channel-native-programs";
strictDeps = true;
nativeBuildInputs = with final.buildPackages; [
pkg-config
];
buildInputs = with final; [
nixVersions.nix_2_28
nlohmann_json
boost
];
buildCommand = ''
mkdir -p $out/bin
$CXX \
-Os -g -Wall \
-std=c++14 \
$(pkg-config --libs --cflags nix-store) \
$(pkg-config --libs --cflags nix-main) \
-I . \
${./index-debuginfo.cc} \
-o $out/bin/index-debuginfo
'';
};
nixos-channel-scripts = final.stdenv.mkDerivation {
name = "nixos-channel-scripts";
strictDeps = true;
nativeBuildInputs = with final.buildPackages; [
makeWrapper
];
buildInputs = with final.perlPackages; [
final.perl
FileSlurp
LWP
LWPProtocolHttps
ListMoreUtils
DBDSQLite
NetAmazonS3
];
buildCommand = ''
mkdir -p $out/bin
cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch
wrapProgram $out/bin/mirror-nixos-branch \
--set PERL5LIB $PERL5LIB \
--set XZ_OPT "-T0" \
--prefix PATH : ${
final.lib.makeBinPath (
with final;
[
wget
git
nix
gnutar
xz
rsync
openssh
nix-index
nixos-channel-native-programs
]
)
}
patchShebangs $out/bin
'';
};
};
packages.x86_64-linux.default =
(import nixpkgs {
system = "x86_64-linux";
overlays = [ self.overlays.default ];
}).nixos-channel-scripts;
checks.x86_64-linux.default = self.packages.x86_64-linux.default;
};
}