summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/github-hosts-sync/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2019-06-14 18:41:27 +0200
committermakefu <github@syntax-fehler.de>2019-06-14 18:41:27 +0200
commit276ad5f9d54a30c6817d00799af49199a5ef9e4c (patch)
treed441e34c262f08eddf9d84c01508e698468fbbfb /krebs/5pkgs/simple/github-hosts-sync/default.nix
parent592d157eba8f1b5ba35f1fca64c2905897468f83 (diff)
parent4e7af580d81f02f6d07d38917f124f4b99483603 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/simple/github-hosts-sync/default.nix')
-rw-r--r--krebs/5pkgs/simple/github-hosts-sync/default.nix39
1 files changed, 17 insertions, 22 deletions
diff --git a/krebs/5pkgs/simple/github-hosts-sync/default.nix b/krebs/5pkgs/simple/github-hosts-sync/default.nix
index cdfed468..fbc48fa3 100644
--- a/krebs/5pkgs/simple/github-hosts-sync/default.nix
+++ b/krebs/5pkgs/simple/github-hosts-sync/default.nix
@@ -1,37 +1,32 @@
{ pkgs, stdenv, ... }:
-stdenv.mkDerivation {
- name = "github-hosts-sync";
+stdenv.mkDerivation rec {
+ name = "github-hosts-sync-${version}";
+ version = "2.0.0";
- src = pkgs.painload;
+ src = ./src;
phases = [
"unpackPhase"
"installPhase"
];
- installPhase =
- let
- ca-bundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
- path = stdenv.lib.makeBinPath (with pkgs; [
- coreutils
- findutils
- git
- gnugrep
- gnused
- nettools
- openssh
- socat
- ]);
- in
+ installPhase = let
+ ca-bundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
+ path = stdenv.lib.makeBinPath [
+ pkgs.git
+ pkgs.nettools
+ pkgs.openssh
+ pkgs.rsync
+ ];
+ 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
+ cp hosts-sync $out/bin/github-hosts-sync
- chmod +x $out/bin/github-hosts-sync
+ sed -i \
+ '1s,$,\nPATH=${path}''${PATH+:$PATH} GIT_SSL_CAINFO=${ca-bundle},' \
+ $out/bin/github-hosts-sync
'';
}