From 04d64fafbc53c745f28f5ea4715488d07b6332c2 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 5 Jul 2022 11:56:48 +0200 Subject: Add useGgpme option to flake.nix to toggle building ledger with support for encrypted journal files using gpgme. --- flake.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 468ba46d..cc93053d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ description = "A double-entry accounting system with a command-line reporting interface"; outputs = { self, nixpkgs }: let + useGpgme = true; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; @@ -17,11 +18,16 @@ src = self; nativeBuildInputs = with pkgs; [ cmake ]; - buildInputs = with pkgs; [ boost gmp mpfr libedit python3 texinfo gnused gpgme ]; + buildInputs = with pkgs; [ + boost gmp mpfr libedit python3 texinfo gnused + ] ++ pkgs.lib.optional useGpgme gpgme; enableParallelBuilding = true; - cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" "-DUSE_GPGME=1" ]; + cmakeFlags = [ + "-DCMAKE_INSTALL_LIBDIR=lib" + (pkgs.lib.optionalString useGpgme "-DUSE_GPGME=1") + ]; checkPhase = '' export LD_LIBRARY_PATH=$PWD -- cgit v1.2.3