about summary refs log tree commit diff stats
path: root/rust/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'rust/default.nix')
-rw-r--r--rust/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/rust/default.nix b/rust/default.nix
new file mode 100644
index 0000000..75e6b2a
--- /dev/null
+++ b/rust/default.nix
@@ -0,0 +1,42 @@
+{
+  description = ""; # TODO fill
+
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+    flake-utils.url = "github:numtide/flake-utils";
+
+    crane = {
+      url = "github:ipetkov/crane";
+      inputs = {
+        nixpkgs.follows = "nixpkgs";
+        flake-utils.follows = "flake-utils";
+      };
+    };
+  };
+
+  outputs = {
+    self,
+    nixpkgs,
+    crane,
+    flake-utils,
+    ...
+  }:
+    flake-utils.lib.eachDefaultSystem (system: let
+      craneLib = crane.lib.${system};
+      craneBuild = craneLib.buildPackage {
+        src = craneLib.cleanCargoSource ./.;
+
+        doCheck = true;
+      };
+      appName = ""; # TODO fill
+    in {
+      packages.default = craneBuild;
+      legacyPackages.default = craneBuild;
+      app.default = {
+        type = "app";
+        program = "${self.packages.${system}.default}/bin/${appName}";
+      };
+    });
+}
+# vim: ts=2
+