1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-01-08 20:33:36 +01:00

add nix build instructions and README section (#173)

# Conflicts:
#	README.md
This commit is contained in:
Phillip Seeber 2024-12-11 16:15:12 +01:00 committed by GitHub
parent 3d76eab5dd
commit df0e3a8e1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 169 additions and 1 deletions

View File

@ -38,6 +38,7 @@ single- and/or multi-reference wave functions:
* [Conda](#conda) * [Conda](#conda)
* [Spack](#spack) * [Spack](#spack)
* [Guix](#guix) * [Guix](#guix)
* [Nix](#nix)
* [Debian/Ubuntu](#debianubuntu) * [Debian/Ubuntu](#debianubuntu)
* [Installation from source](#installation-from-source) * [Installation from source](#installation-from-source)
* [Minimal requirements (for users):](#minimal-requirements-for-users) * [Minimal requirements (for users):](#minimal-requirements-for-users)
@ -100,6 +101,23 @@ It can be installed as follows:
guix package --cores=`getconf _NPROCESSORS_ONLN` --install-from-file=trexio.scm guix package --cores=`getconf _NPROCESSORS_ONLN` --install-from-file=trexio.scm
``` ```
#### Nix
The official releases of TREXIO `>=2.5.` can be used and installed via [Nix](https://nixos.org/).
This repository provides a [Nix Flake](https://nixos.wiki/wiki/Flakes), where [tools/nix/trexio.nix](https://github.com/TREX-CoE/trexio/blob/master/tools/nix/trexio.nix) provides the build specification.
You can inspect the flake or build the package with
```
nix flake show github:TREX-CoE/trexio
nix build github:TREX-CoE/trexio
```
TREXIO is also part of [NixPkgs](https://github.com/NixOS/nixpkgs) and can be used via that channel.
```
nix build nixpkgs#trexio
```
#### Debian/Ubuntu #### Debian/Ubuntu
The official release of TREXIO `2.2.0` is available as a Debian (`.deb`) package thanks to the [Debichem Team](https://wiki.debian.org/Debichem). The official release of TREXIO `2.2.0` is available as a Debian (`.deb`) package thanks to the [Debichem Team](https://wiki.debian.org/Debichem).

60
flake.lock generated Normal file
View File

@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1733852629,
"narHash": "sha256-lXMmrcEg1WxEdPiXpUfkxbJij0xS5acao1Jz4lnrNPY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9ad61cfc19c1f66e7d7d1ac9c71ae1b187065580",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

24
flake.nix Normal file
View File

@ -0,0 +1,24 @@
{
description = "TREX I/O library";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let overlay = import ./tools/nix/overlay.nix;
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
in
{
packages.default = pkgs.trexio;
}
) // {
overlays.default = overlay;
};
}

11
tools/nix/overlay.nix Normal file
View File

@ -0,0 +1,11 @@
final: prev: {
trexio = final.callPackage ./trexio.nix { };
haskell = prev.haskell // {
packageOverrides = hfinal: hprev: {
trexio-hs = hfinal.callCabal2nix "trexio" ../haskell {
inherit (final) trexio;
};
};
};
}

55
tools/nix/trexio.nix Normal file
View File

@ -0,0 +1,55 @@
{ stdenv
, lib
, fetchFromGitHub
, cmake
, gfortran
, hdf5
, python3
, emacs
, swig
}:
stdenv.mkDerivation rec {
pname = "trexio";
version = "2.5.0";
src = lib.cleanSourceWith {
src = ../../.;
filter = path: type: ! (builtins.elem (builtins.baseNameOf path) [
"haskell"
"docker"
"helpers-debian"
"ocaml"
"rust"
"python"
] && type == "directory" );
};
postPatch = ''
patchShebangs tools/*
'';
nativeBuildInputs = [
cmake
gfortran
emacs
swig
python3
];
buildInputs = [
hdf5
];
outputs = [ "out" "dev" ];
doCheck = true;
meta = with lib; {
description = "File format and library for the storage of quantum chemical wave functions";
homepage = "https://trex-coe.github.io/trexio/";
downloadPage = "https://github.com/TREX-CoE/trexio";
license = licenses.bsd3;
maintainers = [ maintainers.sheepforce ];
};
}

View File

@ -5,4 +5,4 @@ To update the version, change:
- ocaml/trexio/trexio.opam - ocaml/trexio/trexio.opam
- python/pytrexio/_version.py - python/pytrexio/_version.py
- rust/trexio/Cargo.toml - rust/trexio/Cargo.toml
- tools/nix/trexio.nix