mailnag: implement a withPlugins interface
This commit is contained in:
parent
ddb962bec4
commit
6c3d919edf
@ -15,19 +15,13 @@
|
|||||||
, gobject-introspection
|
, gobject-introspection
|
||||||
# Available plugins (can be overriden)
|
# Available plugins (can be overriden)
|
||||||
, availablePlugins
|
, availablePlugins
|
||||||
# Plugins to install
|
# Used in the withPlugins interface at passthru, can be overrided directly, or
|
||||||
, plugins ? [ "goa" ]
|
# prefarably via e.g: `mailnag.withPlugins(["goa"])`
|
||||||
|
, mailnag
|
||||||
|
, userPlugins ? [ ]
|
||||||
|
, pluginsDeps ? [ ]
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
# Get the list of plugins the user wants
|
|
||||||
userPlugins = lib.attrVals plugins availablePlugins;
|
|
||||||
# goa plugin requires gio's gnome-online-accounts which requires making sure
|
|
||||||
# mailnag runs with GI_TYPELIB_PATH containing the path to Goa-1.0.typelib.
|
|
||||||
# This is handled best by adding the plugins' deps to buildInputs and let
|
|
||||||
# wrapGAppsHook handle that.
|
|
||||||
pluginsDeps = lib.flatten (lib.catAttrs "buildInputs" userPlugins);
|
|
||||||
in
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "mailnag";
|
pname = "mailnag";
|
||||||
version = "2.0.0";
|
version = "2.0.0";
|
||||||
@ -68,6 +62,17 @@ in
|
|||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit availablePlugins;
|
inherit availablePlugins;
|
||||||
|
withPlugins =
|
||||||
|
plugs:
|
||||||
|
let
|
||||||
|
# goa plugin requires gio's gnome-online-accounts which requires making sure
|
||||||
|
# mailnag runs with GI_TYPELIB_PATH containing the path to Goa-1.0.typelib.
|
||||||
|
# This is handled best by adding the plugins' deps to buildInputs and let
|
||||||
|
# wrapGAppsHook handle that.
|
||||||
|
pluginsDeps = lib.flatten (lib.catAttrs "buildInputs" plugs);
|
||||||
|
self = mailnag;
|
||||||
|
in
|
||||||
|
self.override { userPlugins = plugs; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# See https://nixos.org/nixpkgs/manual/#ssec-gnome-common-issues-double-wrapped
|
# See https://nixos.org/nixpkgs/manual/#ssec-gnome-common-issues-double-wrapped
|
||||||
|
@ -5213,6 +5213,9 @@ in
|
|||||||
goa = callPackage ../applications/networking/mailreaders/mailnag/goa-plugin.nix { };
|
goa = callPackage ../applications/networking/mailreaders/mailnag/goa-plugin.nix { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
mailnagWithPlugins = mailnag.withPlugins(
|
||||||
|
builtins.attrValues mailnag.availablePlugins
|
||||||
|
);
|
||||||
|
|
||||||
mailsend = callPackage ../tools/networking/mailsend { };
|
mailsend = callPackage ../tools/networking/mailsend { };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user