summaryrefslogtreecommitdiff
path: root/pkgs/zone-files/default.nix
blob: 01e0614012e6584766892b12aebecc27472fb956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ stdenv }:

stdenv.mkDerivation rec {
  version = "1.0";
  name = "zone-files-${version}";

  src = ../../data/dns;

  installPhase = ''
    mkdir $out
    cp $src/* $out/

    # Rewrite relative include paths
    sed $out/* -i -e 's,^$INCLUDE \([^/]\),$INCLUDE '$out'/\1,'

    # Substitute serials
    now=$(date +%s)
    sed $out/* -i -e 's/$serial/'$now'/'
  '';
}