From 486676f24887355a0e74f418205d5b90ffaf900d Mon Sep 17 00:00:00 2001 From: Jani Mustonen Date: Sat, 5 Aug 2017 18:40:00 +0300 Subject: [PATCH] Add basic nix expressions (#47) Allows `nix-build` for basic building and `nix-env -f . -i` for installing. --- .gitignore | 4 ++++ README.md | 12 ++++++++++++ default.nix | 3 +++ package.nix | 13 +++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 default.nix create mode 100644 package.nix diff --git a/.gitignore b/.gitignore index bfd07a85..ada23bf5 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,7 @@ Icon Network Trash Folder Temporary Items .apdisk + +# Nix +result + diff --git a/README.md b/README.md index 335192e5..7395dbc9 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,18 @@ make -C build The `nheko` binary will be located in the `build` directory. +##### Nix + +Download the repo as mentioned above and run + +```bash +nix-build +``` + +in the project folder. This will output a binary to `result/bin/nheko`. + +You can also install nheko by running `nix-env -f . -i` + ### Contributing Any kind of contribution to the project is greatly appreciated. You are also diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..b7cfec18 --- /dev/null +++ b/default.nix @@ -0,0 +1,3 @@ +with import {}; +qt59.callPackage ./package.nix {} + diff --git a/package.nix b/package.nix new file mode 100644 index 00000000..915f9db3 --- /dev/null +++ b/package.nix @@ -0,0 +1,13 @@ +{ pkgs, stdenv, qtbase, qttranslations, lmdb, mkDerivation, cmake }: +stdenv.mkDerivation rec { + version = "0.1.0"; + name = "nheko-${version}"; + src = ./.; + nativeBuildInputs = [ cmake ]; + buildInputs = [ qtbase qttranslations lmdb ]; + installPhase = '' + mkdir -p $out/bin + cp nheko $out/bin/nheko + ''; +} +