diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2021-12-01 20:21:17 -0600 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2021-12-01 20:21:17 -0600 |
commit | dfa2fbc45bb0f1e447d574d776e4cd1eb1cfeab3 (patch) | |
tree | 1c9c27aebb5a849ce8aaac9a9b717d986807e628 /flake.nix | |
parent | ed5886921bcce0d1a261a37aa83bf135259b7d21 (diff) | |
download | fork-ledger-dfa2fbc45bb0f1e447d574d776e4cd1eb1cfeab3.tar.gz fork-ledger-dfa2fbc45bb0f1e447d574d776e4cd1eb1cfeab3.tar.bz2 fork-ledger-dfa2fbc45bb0f1e447d574d776e4cd1eb1cfeab3.zip |
Add flake
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..dc35830a --- /dev/null +++ b/flake.nix @@ -0,0 +1,54 @@ +{ + 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 + 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); + + }; +} |