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

37 lines
695 B
Nix
Raw Normal View History

2016-11-10 20:49:48 +00:00
{ pkgs, stdenv, ... }:
2015-07-19 14:03:35 +00:00
stdenv.mkDerivation {
name = "github-hosts-sync";
2016-11-10 20:49:48 +00:00
src = pkgs.painload;
2015-07-19 14:03:35 +00:00
phases = [
"unpackPhase"
"installPhase"
];
installPhase =
let
2015-10-09 12:31:25 +00:00
ca-bundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
2016-03-03 18:45:46 +00:00
path = stdenv.lib.makeBinPath (with pkgs; [
2015-07-19 14:03:35 +00:00
coreutils
findutils
git
gnugrep
gnused
openssh
socat
]);
in
''
mkdir -p $out/bin
sed \
's,^main() {$,&\n export PATH=${path} GIT_SSL_CAINFO=${ca-bundle},' \
< ./retiolum/scripts/github_hosts_sync/hosts-sync \
> $out/bin/github-hosts-sync
chmod +x $out/bin/github-hosts-sync
'';
}