summary refs log tree commit diff
path: root/pkgs/os-specific/linux/hibernate/default.nix
blob: 2b6a9bda374154fb1378f26492e20ed9249fe945 (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
{ stdenv, fetchurl, gawk }:

let version = "1.98.1";
in
  stdenv.mkDerivation rec {
    name = "hibernate-${version}";
    src = fetchurl {
      url = "http://www.tuxonice.net/downloads/all/hibernate-script-${version}.tar.gz";
      sha256 = "1xpc2i16jczc3nhvxlkn6fb044srqrh528gnp92cwy4hxf2nzi1z";
    };

    patches = [ ./install.patch ./gen-manpages.patch ];

    buildInputs = [ gawk ];

    installPhase = ''
      # FIXME: Storing config files under `$out/etc' is not very useful.
      PREFIX="$out" CONFIG_PREFIX="$out" ./install.sh
    '';

    meta = {
      description = "The `hibernate' script for swsusp and Tux-on-Ice";
      longDescription = ''
        This package provides the `hibernate' script, a command-line utility
	that saves the computer's state to disk and switches it off, turning
	it into "hibernation".  It works both with Linux swsusp and Tux-on-Ice.
      '';

      license = "GPLv2+";
      homepage = http://www.tuxonice.net/;
    };
  }