depot/pkgs/by-name/di/dinit/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

51 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
m4,
installShellFiles,
util-linux,
}:
stdenv.mkDerivation rec {
pname = "dinit";
version = "0.19.1";
src = fetchFromGitHub {
owner = "davmac314";
repo = "dinit";
rev = "v${version}";
hash = "sha256-z5qfC+aUwSK7UJ2RcyNHcUAUYXKbMrWmqmcn7fJVLD8=";
};
postPatch = ''
substituteInPlace src/shutdown.cc \
--replace-fail '"/bin/umount"' '"${util-linux}/bin/umount"' \
--replace-fail '"/sbin/swapoff"' '"${util-linux}/bin/swapoff"'
'';
nativeBuildInputs = [
m4
installShellFiles
];
configureFlags = [
"--prefix=${placeholder "out"}"
"--sbindir=${placeholder "out"}/bin"
];
postInstall = ''
installShellCompletion --cmd dinitctl \
--bash contrib/shell-completion/bash/dinitctl \
--fish contrib/shell-completion/fish/dinitctl.fish \
--zsh contrib/shell-completion/zsh/_dinit
'';
meta = {
description = "A service manager / supervision system, which can (on Linux) also function as a system manager and init";
homepage = "https://davmac.org/projects/dinit";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ aanderse ];
platforms = lib.platforms.unix;
};
}