forked from mirrors/nixpkgs
0f8e972f01
* `--with-timestamp` enables the usage of the `persist` setting in `doas.conf`. It is possible some people might not want this, so the flag `withTimestamp` was added to control this. * `--pamdir` copies the PAM files to `$out/etc/pam.d`. This may or may not have a use in the future, but it removes a some errors from the build (when it tries to copy these files to /etc/pam.d).
43 lines
906 B
Nix
43 lines
906 B
Nix
{ stdenv
|
|
, lib
|
|
, fetchFromGitHub
|
|
, bison
|
|
, pam
|
|
|
|
, withTimestamp ? true
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "doas";
|
|
version = "6.6.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Duncaen";
|
|
repo = "OpenDoas";
|
|
rev = "v${version}";
|
|
sha256 = "07kkc5729p654jrgfsc8zyhiwicgmq38yacmwfvay2b3gmy728zn";
|
|
};
|
|
|
|
# otherwise confuses ./configure
|
|
dontDisableStatic = true;
|
|
|
|
configureFlags = [
|
|
(lib.optionalString withTimestamp "--with-timestamp") # to allow the "persist" setting
|
|
"--pamdir=${placeholder "out"}/etc/pam.d"
|
|
];
|
|
|
|
postPatch = ''
|
|
sed -i '/\(chown\|chmod\)/d' bsd.prog.mk
|
|
'';
|
|
|
|
buildInputs = [ bison pam ];
|
|
|
|
meta = with lib; {
|
|
description = "Executes the given command as another user";
|
|
homepage = "https://github.com/Duncaen/OpenDoas";
|
|
license = licenses.isc;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ cole-h cstrahan ];
|
|
};
|
|
}
|