Unverified Commit 0012df53 authored by Onni Hakala's avatar Onni Hakala
Browse files

age-plugin-se: init at 0.1.4

parent c11863f1
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -18055,6 +18055,12 @@
    githubId = 817073;
    name = "Yc. Shen";
  };
  onnimonni = {
    email = "onni@flaky.build";
    github = "onnimonni";
    githubId = 5691777;
    name = "Onni Hakala";
  };
  onny = {
    email = "onny@project-insanity.org";
    github = "onny";
@@ -20386,6 +20392,11 @@
    githubId = 4196789;
    name = "Nathan Ringo";
  };
  remko = {
    github = "remko";
    githubId = 12300;
    name = "Remko Tronçon";
  };
  remyvv = {
    name = "Remy van Velthuijsen";
    email = "remy@remysplace.de";
+63 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  swiftPackages,
  swift,
  swiftpm,
  nix-update-script,
}:
let
  inherit (swiftPackages) stdenv;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "age-plugin-se";
  version = "0.1.4";

  src = fetchFromGitHub {
    owner = "remko";
    repo = "age-plugin-se";
    tag = "v${finalAttrs.version}";
    hash = "sha256-sg73DzlW4aXNbIIePZox4JkF10OfsMtPw0q/0DWwgDk=";
  };

  nativeBuildInputs = [
    swift
    swiftpm
  ];

  postPatch =
    let
      swift-crypto = fetchFromGitHub {
        owner = "apple";
        repo = "swift-crypto";
        # FIXME: Update to a newer version once https://github.com/NixOS/nixpkgs/issues/343210 is fixed
        # This is the last version to support swift tools 5.8 which is newest version supported by nixpkgs:
        # https://github.com/apple/swift-crypto/commit/35703579f63c2518fc929a1ce49805ba6134137c
        tag = "3.7.1";
        hash = "sha256-zxmHxTryAezgqU5qjXlFFThJlfUsPxb1KRBan4DSm9A=";
      };
    in
    ''
      ln -s ${swift-crypto} swift-crypto
      substituteInPlace Package.swift --replace-fail 'url: "https://github.com/apple/swift-crypto.git"' 'path: "./swift-crypto"), //'
    '';

  makeFlags = [
    "PREFIX=$(out)"
    "RELEASE=1"
  ];

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Age plugin for Apple's Secure Enclave";
    homepage = "https://github.com/remko/age-plugin-se/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      onnimonni
      remko
    ];
    mainProgram = "age-plugin-se";
    platforms = lib.platforms.darwin;
  };
})
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
  fetchFromGitHub,
  installShellFiles,
  age-plugin-tpm,
  age-plugin-se,
  age-plugin-sss,
  age-plugin-ledger,
  age-plugin-yubikey,
@@ -59,6 +60,7 @@ buildGoModule (final: {
  passthru.plugins = {
    inherit
      age-plugin-tpm
      age-plugin-se
      age-plugin-sss
      age-plugin-ledger
      age-plugin-yubikey