From 9068ff292c8627bb09cf44e508ace2a352fe4e2f Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Sun, 28 Feb 2021 12:02:53 +0100 Subject: [PATCH] offlineimap: precompile get_settings.py Fixes #1802 --- modules/programs/offlineimap.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/programs/offlineimap.nix b/modules/programs/offlineimap.nix index b6ba847e9..177c0ca5e 100644 --- a/modules/programs/offlineimap.nix +++ b/modules/programs/offlineimap.nix @@ -158,6 +158,17 @@ in { home.packages = [ pkgs.offlineimap ]; xdg.configFile."offlineimap/get_settings.py".text = cfg.pythonFile; + xdg.configFile."offlineimap/get_settings.pyc".source = "${ + pkgs.runCommandLocal "get_settings-compile" { + nativeBuildInputs = [ pkgs.python2 ]; + pythonFile = cfg.pythonFile; + passAsFile = [ "pythonFile" ]; + } '' + mkdir -p $out/bin + cp $pythonFilePath $out/bin/get_settings.py + python2 -m py_compile $out/bin/get_settings.py + '' + }/bin/get_settings.pyc"; xdg.configFile."offlineimap/config".text = '' # Generated by Home Manager.