mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 03:09:47 +01:00
offlineimap: Add package option (#4021)
This commit is contained in:
parent
d437f0d4e0
commit
cbbceb4894
1 changed files with 13 additions and 3 deletions
|
@ -30,7 +30,7 @@ let
|
||||||
genOfflineImapScript = account:
|
genOfflineImapScript = account:
|
||||||
with account;
|
with account;
|
||||||
pkgs.writeShellScriptBin "offlineimap-${name}" ''
|
pkgs.writeShellScriptBin "offlineimap-${name}" ''
|
||||||
exec ${pkgs.offlineimap}/bin/offlineimap -a${account.name} "$@"
|
exec ${cfg.package}/bin/offlineimap -a${account.name} "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
accountStr = account:
|
accountStr = account:
|
||||||
|
@ -90,6 +90,16 @@ in {
|
||||||
programs.offlineimap = {
|
programs.offlineimap = {
|
||||||
enable = mkEnableOption "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 {
|
pythonFile = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = ''
|
default = ''
|
||||||
|
@ -153,12 +163,12 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
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.py".text = cfg.pythonFile;
|
||||||
xdg.configFile."offlineimap/get_settings.pyc".source = "${
|
xdg.configFile."offlineimap/get_settings.pyc".source = "${
|
||||||
pkgs.runCommandLocal "get_settings-compile" {
|
pkgs.runCommandLocal "get_settings-compile" {
|
||||||
nativeBuildInputs = [ pkgs.offlineimap ];
|
nativeBuildInputs = [ cfg.package ];
|
||||||
pythonFile = cfg.pythonFile;
|
pythonFile = cfg.pythonFile;
|
||||||
passAsFile = [ "pythonFile" ];
|
passAsFile = [ "pythonFile" ];
|
||||||
} ''
|
} ''
|
||||||
|
|
Loading…
Reference in a new issue