From 4ca7f468634b3defd8ab6078673cb9421beee408 Mon Sep 17 00:00:00 2001 From: Charles Strahan Date: Tue, 7 Nov 2017 15:43:06 -0500 Subject: [PATCH] doas: init at 6.0 Portable version of the OpenBSD `doas` command. --- pkgs/tools/security/doas/default.nix | 31 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/tools/security/doas/default.nix diff --git a/pkgs/tools/security/doas/default.nix b/pkgs/tools/security/doas/default.nix new file mode 100644 index 000000000000..55335927b36a --- /dev/null +++ b/pkgs/tools/security/doas/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchFromGitHub, bison, pam }: + +stdenv.mkDerivation rec { + name = "doas-${version}"; + + version = "6.0"; + + src = fetchFromGitHub { + owner = "Duncaen"; + repo = "OpenDoas"; + rev = "v${version}"; + sha256 = "1j50l3jvbgvg8vmp1nx6vrjxkbj5bvfh3m01bymzfn25lkwwhz1x"; + }; + + # otherwise confuses ./configure + dontDisableStatic = true; + + 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; [ cstrahan ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7383df20c0ec..9c8080003f17 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1753,6 +1753,8 @@ with pkgs; inherit (perlPackages) PerlMagick; }; + doas = callPackage ../tools/security/doas { }; + docbook2x = callPackage ../tools/typesetting/docbook2x { inherit (perlPackages) XMLSAX XMLParser XMLNamespaceSupport; };