nixpkgs/pkgs/tools/security/doas/default.nix
Cole Helbling 0f8e972f01
doas: enable timestamp by default and set pamdir
* `--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).
2020-05-17 11:42:50 -07:00

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 ];
};
}