mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-04 05:50:00 +00:00
59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
m4,
|
|
installShellFiles,
|
|
util-linuxMinimal,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "dinit";
|
|
version = "0.22.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "davmac314";
|
|
repo = "dinit";
|
|
rev = "v${finalAttrs.version}";
|
|
# fix for case-insensitive filesystems
|
|
postFetch = ''
|
|
[ -f "$out/BUILD" ] && rm "$out/BUILD"
|
|
'';
|
|
hash = "sha256-LerUex/P8UYFWG0TK8LAFPlFBNIVIH2cZfBxe6AD7Sc=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace src/shutdown.cc \
|
|
--replace-fail '"/bin/umount"' '"${util-linuxMinimal}/bin/umount"' \
|
|
--replace-fail '"/sbin/swapoff"' '"${util-linuxMinimal}/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 = "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
|
|
lillecarl
|
|
];
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|