summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/github-hosts-sync/default.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2019-06-25 22:43:02 +0200
committerjeschli <jeschli@gmail.com>2019-06-25 22:43:02 +0200
commit1cfc265bbfa14b7d9fc6479bcd9cf541e7cdd5eb (patch)
tree18b95faba964f8072d23afcadcadda4f3eb276af /krebs/5pkgs/simple/github-hosts-sync/default.nix
parent8079877eee34d0a658e8419adfa8987e648388a8 (diff)
parent1d23dceb5d2c536790a00fcde30743b958f1018f (diff)
Merge branch 'master' of prism.r:stockholm
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
'';
}