offlineimap: Add package option (#4021)
This commit is contained in:
parent
d437f0d4e0
commit
cbbceb4894
|
@ -30,7 +30,7 @@ let
|
|||
genOfflineImapScript = account:
|
||||
with account;
|
||||
pkgs.writeShellScriptBin "offlineimap-${name}" ''
|
||||
exec ${pkgs.offlineimap}/bin/offlineimap -a${account.name} "$@"
|
||||
exec ${cfg.package}/bin/offlineimap -a${account.name} "$@"
|
||||
'';
|
||||
|
||||
accountStr = account:
|
||||
|
@ -90,6 +90,16 @@ in {
|
|||
programs.offlineimap = {
|
||||
enable = mkEnableOption "OfflineIMAP";
|
||||
|
||||
package = mkPackageOption pkgs "offlineimap" {
|
||||
example = ''
|
||||
pkgs.offlineimap.overridePythonAttrs ( old: {
|
||||
propagatedBuildInputs = old.propagatedBuildInputs
|
||||
++ (with pkgs.python3Packages; [
|
||||
requests_oauthlib xdg gpgme]);
|
||||
})'';
|
||||
extraDescription = "Can be used to specify extensions.";
|
||||
};
|
||||
|
||||
pythonFile = mkOption {
|
||||
type = types.lines;
|
||||
default = ''
|
||||
|
@ -153,12 +163,12 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.offlineimap ];
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."offlineimap/get_settings.py".text = cfg.pythonFile;
|
||||
xdg.configFile."offlineimap/get_settings.pyc".source = "${
|
||||
pkgs.runCommandLocal "get_settings-compile" {
|
||||
nativeBuildInputs = [ pkgs.offlineimap ];
|
||||
nativeBuildInputs = [ cfg.package ];
|
||||
pythonFile = cfg.pythonFile;
|
||||
passAsFile = [ "pythonFile" ];
|
||||
} ''
|
||||
|
|
Loading…
Reference in a new issue