stockholm/krebs/5pkgs/simple/github-hosts-sync/default.nix

33 lines
597 B
Nix
Raw Normal View History

{ lib, pkgs, stdenv }:
2015-07-19 14:03:35 +00:00
2019-05-17 11:06:36 +00:00
stdenv.mkDerivation rec {
name = "github-hosts-sync-${version}";
version = "2.0.0";
2015-07-19 14:03:35 +00:00
src = ./src;
2015-07-19 14:03:35 +00:00
phases = [
"unpackPhase"
"installPhase"
];
2019-05-17 11:06:36 +00:00
installPhase = let
ca-bundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
path = lib.makeBinPath [
2019-05-17 11:06:36 +00:00
pkgs.git
2019-05-17 11:53:55 +00:00
pkgs.nettools
2019-05-17 11:06:36 +00:00
pkgs.openssh
pkgs.rsync
];
in
2015-07-19 14:03:35 +00:00
''
mkdir -p $out/bin
2019-05-17 11:06:36 +00:00
cp hosts-sync $out/bin/github-hosts-sync
2015-07-19 14:03:35 +00:00
2019-05-17 11:06:36 +00:00
sed -i \
'1s,$,\nPATH=${path}''${PATH+:$PATH} GIT_SSL_CAINFO=${ca-bundle},' \
$out/bin/github-hosts-sync
2015-07-19 14:03:35 +00:00
'';
}