about summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-15T22·24+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-15T22·24+0200
commit71c55b8bb8059654049489d20a84f53d38ff1666 (patch)
tree029db34db9e1e3e662fdfbb8b4e15a148aabad04 /default.nix
parent6fd7ee05f2915c13b87ad3405bfe9ec84bdeee6f (diff)
feat(build): Add Nix build configuration
Adds a Nix build configuration baesd on the default rustPlatform
configuration.

The configuration pins a specific nixpkgs commit (which at the time
was a commit tracking nixpkgs-unstable).
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 000000000000..14e2219a4421
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,31 @@
+{ pkgs ? import <nixpkgs> {}
+, doCheck ? true }:
+
+# This pins the nixpkgs version to an - admittedly arbitrarily chosen
+# - commit with the correct dependencies.
+# This should be removed once the majority of relevant machines are
+# running NixOS 18.03.
+
+let unstable = import (pkgs.fetchFromGitHub {
+  owner  = "NixOS";
+  repo   = "nixpkgs-channels";
+  rev    = "ea145b68a019f6fff89e772e9a6c5f0584acc02c";
+  sha256 = "18jr124cbgc5zvawvqvvmrp8lq9jcscmn5sg8f5xap6qbg1dgf22";
+}) {};
+in with unstable; rustPlatform.buildRustPackage rec {
+  name        = "converse-${version}";
+  version     = "0.1.0";
+  src         = ./.;
+  cargoSha256 = "0a0634v22wazmyym05x4ricqkxwn4r3spv6s2f3ilma65cy6qyrf";
+
+  buildInputs = [ openssl pkgconfig ];
+
+  inherit doCheck;
+
+  meta = with stdenv.lib; {
+    description = "A simple forum software";
+    homepage    = "https://github.com/tazjin/converse";
+    license     = licenses.gpl3;
+    maintainers = [ maintainers.tazjin ];
+  };
+}