| 1 | { |
| 2 | lib, |
| 3 | stdenv, |
| 4 | pkg-config, |
| 5 | nixVersions, |
| 6 | nlohmann_json, |
| 7 | boost, |
| 8 | makeWrapper, |
| 9 | perl, |
| 10 | perlPackages, |
| 11 | wget, |
| 12 | git, |
| 13 | nix, |
| 14 | gnutar, |
| 15 | xz, |
| 16 | zstd, |
| 17 | rsync, |
| 18 | openssh, |
| 19 | nix-index, |
| 20 | }: |
| 21 | let |
| 22 | nixos-channel-native-programs = stdenv.mkDerivation { |
| 23 | name = "nixos-channel-native-programs"; |
| 24 | |
| 25 | strictDeps = true; |
| 26 | |
| 27 | nativeBuildInputs = [ pkg-config ]; |
| 28 | |
| 29 | buildInputs = [ |
| 30 | nixVersions.nix_2_28 |
| 31 | nlohmann_json |
| 32 | boost |
| 33 | ]; |
| 34 | |
| 35 | buildCommand = '' |
| 36 | mkdir -p $out/bin |
| 37 | |
| 38 | $CXX \ |
| 39 | -Os -g -Wall \ |
| 40 | -std=c++14 \ |
| 41 | $(pkg-config --libs --cflags nix-store) \ |
| 42 | $(pkg-config --libs --cflags nix-main) \ |
| 43 | -I . \ |
| 44 | ${./index-debuginfo.cc} \ |
| 45 | -o $out/bin/index-debuginfo |
| 46 | ''; |
| 47 | }; |
| 48 | in |
| 49 | stdenv.mkDerivation { |
| 50 | name = "nixos-channel-scripts"; |
| 51 | |
| 52 | strictDeps = true; |
| 53 | |
| 54 | nativeBuildInputs = [ makeWrapper ]; |
| 55 | |
| 56 | buildInputs = with perlPackages; [ |
| 57 | perl |
| 58 | FileSlurp |
| 59 | LWP |
| 60 | LWPProtocolHttps |
| 61 | ListMoreUtils |
| 62 | DBDSQLite |
| 63 | NetAmazonS3 |
| 64 | ]; |
| 65 | |
| 66 | buildCommand = '' |
| 67 | mkdir -p $out/bin |
| 68 | |
| 69 | cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch |
| 70 | wrapProgram $out/bin/mirror-nixos-branch \ |
| 71 | --set PERL5LIB $PERL5LIB \ |
| 72 | --set XZ_OPT "-T0" \ |
| 73 | --prefix PATH : ${ |
| 74 | lib.makeBinPath [ |
| 75 | wget |
| 76 | git |
| 77 | nix |
| 78 | gnutar |
| 79 | xz |
| 80 | zstd |
| 81 | rsync |
| 82 | openssh |
| 83 | nix-index |
| 84 | nixos-channel-native-programs |
| 85 | ] |
| 86 | } |
| 87 | |
| 88 | patchShebangs $out/bin |
| 89 | ''; |
| 90 | } |