diff options
author | John Wiegley <johnw@newartisans.com> | 2022-02-03 09:04:58 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2022-02-03 09:04:58 -0800 |
commit | 015d6be8346cd779dcf5685a3aeb08b2d59287be (patch) | |
tree | abf907c0b1880572e0cd2d9e1c1d4905c1b7044e /flake.nix | |
parent | bc45e0205d23f5a8f2e3e389195daa85f4b07ec0 (diff) | |
parent | bcbcf169d5fddd48a77e30ef60ba07c0a2e1e1ab (diff) | |
download | fork-ledger-015d6be8346cd779dcf5685a3aeb08b2d59287be.tar.gz fork-ledger-015d6be8346cd779dcf5685a3aeb08b2d59287be.tar.bz2 fork-ledger-015d6be8346cd779dcf5685a3aeb08b2d59287be.zip |
Merge remote-tracking branch 'matthewbauer/add-flake'
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..468ba46d --- /dev/null +++ b/flake.nix @@ -0,0 +1,55 @@ +{ + description = "A double-entry accounting system with a command-line reporting interface"; + + outputs = { self, nixpkgs }: let + 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" ]; + in { + + packages = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + in { + ledger = pkgs.stdenv.mkDerivation { + pname = "ledger"; + version = "3.2.1-${self.shortRev or "dirty"}"; + + src = self; + + nativeBuildInputs = with pkgs; [ cmake ]; + buildInputs = with pkgs; [ boost gmp mpfr libedit python3 texinfo gnused gpgme ]; + + enableParallelBuilding = true; + + cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" "-DUSE_GPGME=1" ]; + + checkPhase = '' + export LD_LIBRARY_PATH=$PWD + export DYLD_LIBRARY_PATH=$PWD + ctest -j$NIX_BUILD_CORES + ''; + + doCheck = true; + + meta = { + homepage = "http://ledger-cli.org/"; + description = "A double-entry accounting system with a command-line reporting interface"; + license = pkgs.lib.licenses.bsd3; + + longDescription = '' + Ledger is a powerful, double-entry accounting system that is accessed + from the UNIX command-line. This may put off some users, as there is + no flashy UI, but for those who want unparalleled reporting access to + their data, there really is no alternative. + ''; + + platforms = pkgs.lib.platforms.all; + maintainers = with pkgs.lib.maintainers; [ jwiegley ]; + }; + }; + }); + + defaultPackage = forAllSystems (system: self.packages.${system}.ledger); + + }; +} |