From a8bcb976dab1bc5049581bd3dc2766d0fb91fcab Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Fri, 17 May 2024 07:47:32 +0200 Subject: [PATCH] Nix build system --- .gitignore | 5 ++++- default.nix | 13 +++++++++++++ shell.nix | 10 ++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 default.nix create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore index 8ec72ff..05602ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ -/target .idea stats.toml + +# Build paths +result +/target diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..01f7e27 --- /dev/null +++ b/default.nix @@ -0,0 +1,13 @@ +{pkgs ? import {}}: let + manifest = (pkgs.lib.importTOML ./Cargo.toml).package; +in + pkgs.rustPlatform.buildRustPackage { + pname = manifest.name; + version = manifest.version; + cargoLock.lockFile = ./Cargo.lock; + src = pkgs.lib.cleanSource ./.; + nativeBuildInputs = [ + ]; + buildInputs = [ + ]; + } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..ae90362 --- /dev/null +++ b/shell.nix @@ -0,0 +1,10 @@ +let + pkgs = import {}; +in + pkgs.mkShell { + name = "crabtype"; + nativeBuildInputs = [ + ]; + buildInputs = [ + ]; + }