From 1fb092b81ef3b8c1a0d50a9c15875374493231fa Mon Sep 17 00:00:00 2001 From: Jan Schmitt Date: Sun, 13 Nov 2022 10:26:01 +0100 Subject: [PATCH] pam_reattach: init at 1.3 --- .../darwin/pam-reattach/default.nix | 45 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/os-specific/darwin/pam-reattach/default.nix diff --git a/pkgs/os-specific/darwin/pam-reattach/default.nix b/pkgs/os-specific/darwin/pam-reattach/default.nix new file mode 100644 index 000000000000..03d0547fc167 --- /dev/null +++ b/pkgs/os-specific/darwin/pam-reattach/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchFromGitHub, cmake, openpam, darwin }: + +let + sdk = + if stdenv.isAarch64 + then null + else darwin.apple_sdk.sdk; +in + +stdenv.mkDerivation rec { + pname = "pam_reattach"; + version = "1.3"; + + src = fetchFromGitHub { + owner = "fabianishere"; + repo = pname; + rev = "v${version}"; + sha256 = "1k77kxqszdwgrb50w7algj22pb4fy5b9649cjb08zq9fqrzxcbz7"; + }; + + cmakeFlags = [ + "-DCMAKE_OSX_ARCHITECTURES=${ + if stdenv.hostPlatform.system == "x86_64-darwin" then + "x86_64" + else + "arm64" + }" + "-DENABLE_CLI=ON" + ] + ++ lib.optional (sdk != null) + "-DCMAKE_LIBRARY_PATH=${sdk}/usr/lib"; + + buildInputs = [ openpam ] + ++ lib.optional (sdk != null) sdk; + + nativeBuildInputs = [ cmake ]; + + meta = with lib; { + homepage = "https://github.com/fabianishere/pam_reattach"; + description = "Reattach to the user's GUI session on macOS during authentication (for Touch ID support in tmux)"; + license = licenses.mit; + maintainers = with maintainers; [ lockejan ]; + platforms = platforms.darwin; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dcf088595606..fa721389680b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2535,6 +2535,8 @@ with pkgs; plausible = callPackage ../servers/web-apps/plausible { }; + pam-reattach = callPackage ../os-specific/darwin/pam-reattach {}; + reattach-to-user-namespace = callPackage ../os-specific/darwin/reattach-to-user-namespace {}; skhd = callPackage ../os-specific/darwin/skhd {