Created
June 19, 2023 18:00
-
-
Save gshpychka/6cf2efbf35d7c4235a0dbfb170ec772e to your computer and use it in GitHub Desktop.
Swift derivation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> { }; | |
stdenv.mkDerivation rec { | |
name = "watchid-pam-extension-${version}"; | |
src = fetchFromGitHub { | |
owner = "jnooree"; | |
repo = "pam-watchid"; | |
rev = "main"; | |
sha256 = "Ni8yyn0dKO8N7SSOeYJMl2XI83chKbDbdpOMegx9k9k="; | |
}; | |
version = "2"; | |
libraryName = "pam_watchid.so"; | |
destination = "/usr/local/lib/pam"; | |
target = "arm64-apple-darwin22.5.0"; | |
buildInputs = [ | |
pkgs.darwin.apple_sdk.frameworks.LocalAuthentication | |
]; | |
buildPhase = '' | |
${pkgs.swift}/bin/swiftc ${src}/watchid-pam-extension.swift -target ${target} -O -Ounchecked -gnone -o $out/${libraryName} -emit-library | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment