channel-scripts/flake.nix
Eelco Dolstra 7ec2d94303
flake.lock: Update
Flake input changes:

* Updated 'nix': 'github:NixOS/nix/73769b28e376cf1fb3e7248bafaa17c35527925d' -> 'github:NixOS/nix/3aaceeb7e2d3fb8a07a1aa5a21df1dca6bbaa0ef'
* Updated 'nix/nixpkgs': 'github:edolstra/nixpkgs/43e283790fbe330b723ac44b584824cf6d85c1ee' -> 'github:NixOS/nixpkgs/b88ff468e9850410070d4e0ccd68c7011f15b2be'
* Updated 'nixpkgs': 'github:edolstra/nixpkgs/54a27fb2fc5fbd8927f9f6dc77fe1de1faa05266' -> 'github:NixOS/nixpkgs/29eddfc36d720dcc4822581175217543b387b1e8'
2020-04-09 17:27:41 +02:00

85 lines
2.3 KiB
Nix

{
edition = 201909;
description = "Script for generating Nixpkgs/NixOS channels";
inputs.nixpkgs.url = "nixpkgs/nixos-20.03";
outputs = { self, nixpkgs, nix }:
{
overlay = final: prev: {
nixos-channel-native-programs = with final; stdenv.mkDerivation {
name = "nixos-channel-native-programs";
buildInputs = [
final.nix
pkgconfig
boehmgc
nlohmann_json
boost
sqlite
];
buildCommand = ''
mkdir -p $out/bin
cp ${./file-cache.hh} file-cache.hh
g++ -Os -g ${./generate-programs-index.cc} -Wall -std=c++14 -o $out/bin/generate-programs-index -I . \
$(pkg-config --cflags nix-main) \
$(pkg-config --libs nix-main) \
$(pkg-config --libs nix-expr) \
$(pkg-config --libs nix-store) \
-lsqlite3 -lgc -lnixrust
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 -lnixrust
'';
};
nixos-channel-scripts = with final; stdenv.mkDerivation {
name = "nixos-channel-scripts";
buildInputs = with final.perlPackages;
[ final.nix
sqlite
makeWrapper
perl
FileSlurp
LWP
LWPProtocolHttps
ListMoreUtils
DBDSQLite
NetAmazonS3
brotli
jq
nixos-channel-native-programs
];
buildCommand = ''
mkdir -p $out/bin
cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch
wrapProgram $out/bin/mirror-nixos-branch \
--set PERL5LIB $PERL5LIB \
--prefix PATH : ${wget}/bin:${git}/bin:${final.nix}/bin:${gnutar}/bin:${xz}/bin:${rsync}/bin:${openssh}/bin:${nixos-channel-native-programs}/bin:$out/bin
patchShebangs $out/bin
'';
};
};
defaultPackage.x86_64-linux = (import nixpkgs {
system = "x86_64-linux";
overlays = [ nix.overlay self.overlay ];
}).nixos-channel-scripts;
};
}