summary refs log tree commit diff
path: root/pkgs/tools/networking/netboot/default.nix
blob: a834ffc37396eeace33a7bc479e52ef9a765a3a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
x@{builderDefsPackage
  , fetchgit, ...}:
builderDefsPackage
(a :  
let 
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
    ["fetchgit"];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    version="git-head-${rev}";
    baseName="netboot";
    rev="19a955cd87b399a5b56";
    name="${baseName}-git-head";
    url="git://github.com/ITikhonov/netboot.git";
    hash="7610c734dc46183439c161d327e7ef6a3d5bc07b5173850b92f71ec047b109d6";
  };
in
rec {
  srcDrv = a.fetchgit {
    url = sourceInfo.url;
    sha256 = sourceInfo.hash;
    rev = sourceInfo.rev;
  };

  src=srcDrv + "/";

  inherit (sourceInfo) name version;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["doBuild" "doDeploy"];

  doBuild = a.fullDepEntry ''
    gcc netboot.c -o netboot
  '' ["doUnpack" "addInputs"];

  doDeploy = a.fullDepEntry ''
    ensureDir "$out/bin"
    cp netboot "$out/bin"
  '' ["defEnsureDir" "minInit"];
      
  meta = {
    description = "Mini PXE server";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
    license = "free-noncopyleft";
  };
  passthru = {
    updateInfo = {
      downloadPage = "https://github.com/ITikhonov/netboot";
    };
  };
}) x