summaryrefslogtreecommitdiff
path: root/nix/rebuild-system.nix
blob: 5c65e880c2c41247250e3a94a4f12fa89e0c2cf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ stdenv
, fetchgit
, makeWrapper
, git
}:

stdenv.mkDerivation rec {
  inherit git;
  name = "rebuild-system-${version}";
  version = "0.1";
  src = ../rebuild-system;
  buildInputs = [ makeWrapper ];
  phases = ["installPhase"];
  installPhase = ''
    mkdir -p $out/bin
    cp $src $out/bin/rebuild-system
    chmod +x $out/bin/rebuild-system
    wrapProgram $out/bin/rebuild-system \
      --prefix PATH : /var/setuid-wrappers \
      --prefix PATH : ${git}/bin
  '';
}