From 83c5a8ccbd29f2deb3720f20ae577246353dbc5a Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 8 Apr 2020 17:49:13 -0400 Subject: [PATCH] add package build --- .gitignore | 1 + cabnytcini.nix | 14 ++++++++++++++ nix/sources.json | 12 ++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 cabnytcini.nix diff --git a/.gitignore b/.gitignore index ea8c4bf..8ea0ee8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +result* diff --git a/cabnytcini.nix b/cabnytcini.nix new file mode 100644 index 0000000..56522b3 --- /dev/null +++ b/cabnytcini.nix @@ -0,0 +1,14 @@ +{ pkgs ? (import (import ./nix/sources.nix).nixpkgs { }) }: + +let + sources = import ./nix/sources.nix; + srcNoTarget = dir: + builtins.filterSource + (path: type: type != "directory" || builtins.baseNameOf path != "target") + dir; + naersk = pkgs.callPackage sources.naersk { }; +in naersk.buildPackage { + src = srcNoTarget ./.; + remapPathPrefix = true; + buildInputs = with pkgs; [ pkg-config openssl xorg.libX11 ]; +} diff --git a/nix/sources.json b/nix/sources.json index ca6cc23..d4eb3a9 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,4 +1,16 @@ { + "naersk": { + "branch": "master", + "description": "Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.", + "homepage": "", + "owner": "nmattia", + "repo": "naersk", + "rev": "1dd63230066a93c61ab7a66934eb0aae3f1a3613", + "sha256": "1xn8m62ypg13jh4zf101qmfa6gy8cl923fgwvk9c33m573h3k154", + "type": "tarball", + "url": "https://github.com/nmattia/naersk/archive/1dd63230066a93c61ab7a66934eb0aae3f1a3613.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "niv": { "branch": "master", "description": "Easy dependency management for Nix projects",