2019-12-30 20:34:49 +00:00
|
|
|
{
|
|
|
|
description = "Script for generating Nixpkgs/NixOS channels";
|
|
|
|
|
2024-02-20 23:00:26 +00:00
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11-small";
|
2019-12-30 20:34:49 +00:00
|
|
|
|
2023-01-12 17:58:42 +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: {
|
2024-05-21 18:46:24 +00:00
|
|
|
nix-index-unwrapped = (prev.nix-index-unwrapped.override {
|
|
|
|
rustPlatform = final.rustPackages_1_76.rustPlatform;
|
|
|
|
}).overrideAttrs(old: rec {
|
|
|
|
version = "0.1.7-unstable-2024-05-11";
|
|
|
|
|
|
|
|
# commit with proper HTTPS fixes
|
|
|
|
# FIXME: unpin after next release
|
|
|
|
src = final.fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "nix-index";
|
|
|
|
rev = "195fb3525038e40836b8d286371365f5e7857c0c";
|
|
|
|
hash = "sha256-Cw6Q9rHcLjPKzab5O4G7cetFAaTZCex2VLvYIhJCbpg=";
|
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = final.rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
hash = "sha256-Pl56f8FU/U/x4gkTt5yXxE8FVQ/pGBDuxxP7HrfsaBc=";
|
|
|
|
};
|
2024-04-17 08:10:51 +00:00
|
|
|
});
|
|
|
|
|
2020-03-24 20:45:01 +00:00
|
|
|
nixos-channel-native-programs = with final; stdenv.mkDerivation {
|
|
|
|
name = "nixos-channel-native-programs";
|
|
|
|
buildInputs = [
|
2023-01-12 17:58:42 +00:00
|
|
|
nix
|
2024-02-20 23:00:26 +00:00
|
|
|
pkg-config
|
2019-12-30 20:51:21 +00:00
|
|
|
boehmgc
|
|
|
|
nlohmann_json
|
|
|
|
boost
|
2020-03-24 20:45:01 +00:00
|
|
|
sqlite
|
|
|
|
];
|
2019-12-30 20:34:49 +00:00
|
|
|
|
2024-02-20 23:26:10 +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) \
|
2024-02-20 23:26:10 +00:00
|
|
|
-lsqlite3 \
|
|
|
|
${nixpkgs.lib.optionalString nixHasSignalsHh "-DHAS_SIGNALS_HH"}
|
2020-03-24 20:45:01 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
nixos-channel-scripts = with final; stdenv.mkDerivation {
|
|
|
|
name = "nixos-channel-scripts";
|
|
|
|
|
2023-01-12 17:58:42 +00:00
|
|
|
buildInputs = with perlPackages;
|
|
|
|
[ nix
|
2020-03-24 20:45:01 +00:00
|
|
|
sqlite
|
|
|
|
makeWrapper
|
|
|
|
perl
|
|
|
|
FileSlurp
|
|
|
|
LWP
|
|
|
|
LWPProtocolHttps
|
|
|
|
ListMoreUtils
|
|
|
|
DBDSQLite
|
|
|
|
NetAmazonS3
|
|
|
|
brotli
|
|
|
|
jq
|
|
|
|
nixos-channel-native-programs
|
2024-04-17 08:10:51 +00:00
|
|
|
nix-index-unwrapped
|
2020-03-24 20:45:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
2019-12-30 20:34:49 +00:00
|
|
|
|
|
|
|
cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch
|
2020-03-24 20:45:01 +00:00
|
|
|
wrapProgram $out/bin/mirror-nixos-branch \
|
|
|
|
--set PERL5LIB $PERL5LIB \
|
2024-02-22 16:03:58 +00:00
|
|
|
--set XZ_OPT "-T0" \
|
2023-01-12 17:58:42 +00:00
|
|
|
--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";
|
2023-01-12 17:58:42 +00:00
|
|
|
overlays = [ self.overlays.default ];
|
2019-12-30 20:34:49 +00:00
|
|
|
}).nixos-channel-scripts;
|
|
|
|
};
|
|
|
|
}
|