nixpkgs/pkgs/by-name/pm/pmutils/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

71 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchurl,
coreutils,
gnugrep,
util-linux,
kmod,
procps,
kbd,
dbus,
}:
let
binPath = lib.makeBinPath [
coreutils
gnugrep
util-linux
kmod
procps
kbd
dbus
];
sbinPath = lib.makeSearchPathOutput "bin" "sbin" [ procps ];
in
stdenv.mkDerivation rec {
pname = "pm-utils";
version = "1.4.1";
src = fetchurl {
url = "https://pm-utils.freedesktop.org/releases/pm-utils-${version}.tar.gz";
sha256 = "02qc6zaf7ams6qcc470fwb6jvr4abv3lrlx16clqpn36501rkn4f";
};
configureFlags = [ "--sysconfdir=/etc" ];
preConfigure = ''
# Install the manpages (xmlto isn't really needed).
substituteInPlace man/Makefile.in --replace '@HAVE_XMLTO_TRUE@' ""
# Set the PATH properly.
substituteInPlace pm/pm-functions.in --replace '/sbin:/usr/sbin:/bin:/usr/bin' '$PATH:${binPath}:${sbinPath}'
substituteInPlace src/pm-action.in --replace 'tr ' '${coreutils}/bin/tr '
substituteInPlace pm/sleep.d/00logging --replace /bin/uname "$(type -P uname)"
substituteInPlace pm/sleep.d/90clock --replace /sbin/hwclock hwclock
'';
postInstall = ''
# Remove some hooks that have doubtful usefulness. See
# http://zinc.canonical.com/~cking/power-benchmarking/pm-utils-results/results.txt.
# In particular, journal-commit breaks things if you have
# read-only bind mounts, since it ends up remounting the
# underlying filesystem read-only.
rm $out/lib/pm-utils/power.d/{journal-commit,readahead}
'';
meta = {
homepage = "https://pm-utils.freedesktop.org/wiki/";
description = "Small collection of scripts that handle suspend and resume on behalf of HAL";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}