10 , withTimestamp ? true
13 stdenv.mkDerivation rec {
17 src = fetchFromGitHub {
21 sha256 = "9uOQ2Ta5HzEpbCz2vbqZEEksPuIjL8lvmfmynfqxMeM=";
24 # otherwise confuses ./configure
25 dontDisableStatic = true;
28 (lib.optionalString withTimestamp "--with-timestamp") # to allow the "persist" setting
29 (lib.optionalString (!withPAM) "--without-pam")
33 # Allow doas to discover binaries in /run/current-system/sw/{s,}bin and
35 ./0001-add-NixOS-specific-dirs-to-safe-PATH.patch
38 # ./configure script does not understand `--disable-shared`
39 dontAddStaticConfigureFlags = true;
42 sed -i '/\(chown\|chmod\)/d' GNUmakefile
43 '' + lib.optionalString (withPAM && stdenv.hostPlatform.isStatic) ''
44 sed -i 's/-lpam/-lpam -laudit/' configure
47 nativeBuildInputs = [ bison ];
49 ++ lib.optional withPAM pam
50 ++ lib.optional (!withPAM) libxcrypt;
52 passthru.tests = { inherit (nixosTests) doas; };
55 description = "Executes the given command as another user";
57 homepage = "https://github.com/Duncaen/OpenDoas";
58 license = licenses.isc;
59 platforms = platforms.linux;
60 maintainers = with maintainers; [ cole-h ];