2019-12-23 12:20:31 +01:00
|
|
|
# Lieer is a small tool to synchronise a Gmail account with a local
|
|
|
|
# maildir.
|
|
|
|
#
|
|
|
|
# Lieer is packaged in nixpkgs, but as of 2019-12-23 it is an old
|
|
|
|
# version using the previous branding (gmailieer).
|
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.third_party;
|
|
|
|
|
2019-12-23 13:26:30 +01:00
|
|
|
let
|
|
|
|
# My employer does not allow third-party projects to use our email
|
|
|
|
# accounts, but I want to use lieer for it anyways.
|
|
|
|
#
|
|
|
|
# To accomplish this the following derivation creates a patch that
|
|
|
|
# replaces the API client with one that I control.
|
|
|
|
authPatch = runCommand "client_secret.patch" {} ''
|
|
|
|
export PATH=${lib.makeBinPath [ gettext ]}:$PATH
|
|
|
|
export CLIENT_SECRET='${builtins.getEnv "LIEER_CLIENT_SECRET"}'
|
|
|
|
cat ${./api_client.patch} | envsubst > $out
|
|
|
|
'';
|
|
|
|
in python3Packages.buildPythonApplication rec {
|
2019-12-23 12:20:31 +01:00
|
|
|
name = "lieer-${version}";
|
|
|
|
version = "1.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gauteh";
|
|
|
|
repo = "lieer";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1zzylv8xbcrh34bz0s29dawzcyx39lai8y8wk0bl4x75v1jfynvf";
|
|
|
|
};
|
|
|
|
|
2019-12-23 13:26:30 +01:00
|
|
|
patches = [ authPatch ];
|
|
|
|
|
2019-12-23 12:20:31 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
notmuch
|
|
|
|
oauth2client
|
|
|
|
google_api_python_client
|
|
|
|
tqdm
|
|
|
|
];
|
|
|
|
}
|