From dea7abd19a88de90cdaadb6d1300f0159b362dc1 Mon Sep 17 00:00:00 2001 From: coolneng Date: Sun, 14 Nov 2021 17:08:33 +0100 Subject: [PATCH] Rebuild cyrus-sasl with XOAUTH2 support --- configuration.nix | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 4 ++++ overlays/cyrus-sasl.nix | 24 ++++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 overlays/cyrus-sasl.nix diff --git a/configuration.nix b/configuration.nix index 6d8828f..b0cf464 100644 --- a/configuration.nix +++ b/configuration.nix @@ -113,6 +113,7 @@ ./modules/cachix.nix ./overlays/emacs.nix ./overlays/nix-direnv.nix + ./overlays/cyrus-sasl.nix ]; } diff --git a/flake.lock b/flake.lock index f83b6e5..315b8ff 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,22 @@ "type": "github" } }, + "cyrus-sasl-xoauth2": { + "flake": false, + "locked": { + "lastModified": 1611713742, + "narHash": "sha256-IaH8tNUhM0lUOmFiG4G9cGzsuM9mTWfQrzoQ78MIgZ0=", + "owner": "robn", + "repo": "sasl2-oauth", + "rev": "4236b6fb904d836b85b55ba32128b843fd8c2362", + "type": "github" + }, + "original": { + "owner": "robn", + "repo": "sasl2-oauth", + "type": "github" + } + }, "emacs-overlay": { "locked": { "lastModified": 1635758635, @@ -53,6 +69,7 @@ "root": { "inputs": { "agenix": "agenix", + "cyrus-sasl-xoauth2": "cyrus-sasl-xoauth2", "emacs-overlay": "emacs-overlay", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 0aa48e3..f37b3d5 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,10 @@ agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "nixpkgs"; emacs-overlay.url = "github:nix-community/emacs-overlay"; + cyrus-sasl-xoauth2 = { + url = "github:robn/sasl2-oauth"; + flake = false; + }; }; outputs = { self, nixpkgs, agenix, ... }@inputs: diff --git a/overlays/cyrus-sasl.nix b/overlays/cyrus-sasl.nix new file mode 100644 index 0000000..392d340 --- /dev/null +++ b/overlays/cyrus-sasl.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, inputs, ... }: + +let + cyrus-sasl-xoauth2 = with pkgs; + stdenv.mkDerivation { + name = "cyrus-sasl-xoauth2"; + src = inputs.cyrus-sasl-xoauth2; + nativeBuildInputs = + [ autoreconfHook inputs.nixpkgs.legacyPackages."${system}".cyrus_sasl ]; + }; + +in { + nixpkgs.overlays = [ + (final: prev: { + cyrus_sasl = prev.cyrus_sasl.overrideAttrs (div: rec { + postInstall = '' + for lib in ${cyrus-sasl-xoauth2}/lib/sasl2/*; do + ln -sf $lib $out/lib/sasl2/ + done + ''; + }); + }) + ]; +}