Skip to content

Instantly share code, notes, and snippets.

@grahamc

grahamc/build.sh Secret

Created January 5, 2018 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/1a248ae5d50feb38676e84481866aeef to your computer and use it in GitHub Desktop.
Save grahamc/1a248ae5d50feb38676e84481866aeef to your computer and use it in GitHub Desktop.
#!/bin/sh
fetchsync() {
src=$1
dest=$2
if [ ! -d "$dest" ]; then
git clone --bare "$src" "$dest"
fi
(
cd "$dest"
git fetch
)
}
mkdir -p sources
fetchsync "git@github.com:grahamc/dns.git" "./sources/dns"
nix-build ./default.nix
let
pkgs = import <nixpkgs> {};
in pkgs.stdenv.mkDerivation {
name = "dns-configs";
src = pkgs.fetchgit {
url = ./sources/dns;
rev = "668f046c23c0ae36fadd5620f6df2560d962c12e";
sha256 = "1xqyxv9q7mj6ww2pcdwpfjnx1x867n7i18m1zid2l597v3d4g7iq";
};
buildPhase = ''
./build.sh
'';
installPhase = ''
cp -r ./bind-cfgs $out
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment