channel-scripts/flake.nix

79 lines
2.3 KiB
Nix
Raw Normal View History

2019-12-30 20:34:49 +00:00
{
description = "Script for generating Nixpkgs/NixOS channels";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11-small";
2019-12-30 20:34:49 +00:00
outputs = { self, nixpkgs }:
2019-12-30 20:34:49 +00:00
{
2022-09-08 12:21:15 +00:00
overlays.default = final: prev: {
nix-index-unwrapped = prev.nix-index-unwrapped.overrideAttrs(old: {
patches = [ ./nix-index-https.patch ];
});
nixos-channel-native-programs = with final; stdenv.mkDerivation {
name = "nixos-channel-native-programs";
buildInputs = [
nix
pkg-config
2019-12-30 20:51:21 +00:00
boehmgc
nlohmann_json
boost
sqlite
];
2019-12-30 20:34:49 +00:00
buildCommand = let
nixHasSignalsHh = nixpkgs.lib.strings.versionAtLeast nix.version "2.19";
in ''
2019-12-30 20:34:49 +00:00
mkdir -p $out/bin
g++ -Os -g ${./index-debuginfo.cc} -Wall -std=c++14 -o $out/bin/index-debuginfo -I . \
$(pkg-config --cflags nix-main) \
$(pkg-config --libs nix-main) \
$(pkg-config --libs nix-store) \
-lsqlite3 \
${nixpkgs.lib.optionalString nixHasSignalsHh "-DHAS_SIGNALS_HH"}
'';
};
nixos-channel-scripts = with final; stdenv.mkDerivation {
name = "nixos-channel-scripts";
buildInputs = with perlPackages;
[ nix
sqlite
makeWrapper
perl
FileSlurp
LWP
LWPProtocolHttps
ListMoreUtils
DBDSQLite
NetAmazonS3
brotli
jq
nixos-channel-native-programs
nix-index-unwrapped
];
buildCommand = ''
mkdir -p $out/bin
2019-12-30 20:34:49 +00:00
cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch
wrapProgram $out/bin/mirror-nixos-branch \
--set PERL5LIB $PERL5LIB \
2024-02-22 16:03:58 +00:00
--set XZ_OPT "-T0" \
--prefix PATH : ${lib.makeBinPath [ wget git nix gnutar xz rsync openssh nix-index nixos-channel-native-programs ]}
2019-12-30 20:34:49 +00:00
patchShebangs $out/bin
'';
};
};
defaultPackage.x86_64-linux = (import nixpkgs {
system = "x86_64-linux";
overlays = [ self.overlays.default ];
2019-12-30 20:34:49 +00:00
}).nixos-channel-scripts;
};
}