Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

76 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
runCommand,
asciidoctor,
coreutils,
gawk,
glibc,
util-linux,
bash,
makeBinaryWrapper,
doas-sudo-shim,
}:
stdenv.mkDerivation rec {
pname = "doas-sudo-shim";
version = "0.1.2";
src = fetchFromGitHub {
owner = "jirutka";
repo = "doas-sudo-shim";
rev = "v${version}";
sha256 = "sha256-jgakKxglJi4LcxXsSE4mEdY/44kPxVb/jF7CgX7dllA=";
};
nativeBuildInputs = [
asciidoctor
makeBinaryWrapper
];
buildInputs = [
bash
coreutils
gawk
glibc
util-linux
];
dontConfigure = true;
dontBuild = true;
installFlags = [
"DESTDIR=$(out)"
"PREFIX=\"\""
];
postInstall = ''
wrapProgram $out/bin/sudo \
--prefix PATH : ${
lib.makeBinPath [
bash
coreutils
gawk
glibc
util-linux
]
}
'';
passthru.tests = {
helpTest = runCommand "${pname}-helpTest" { } ''
${doas-sudo-shim}/bin/sudo -h > $out
grep -q "Execute a command as another user using doas(1)" $out
'';
};
meta = with lib; {
description = "Shim for the sudo command that utilizes doas";
homepage = "https://github.com/jirutka/doas-sudo-shim";
license = licenses.isc;
mainProgram = "sudo";
maintainers = with maintainers; [ dsuetin ];
platforms = platforms.linux;
};
}