summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..a01f74d
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,37 @@
+{
+  inputs = {
+    nixpkgs = {
+      type = "github";
+      owner = "NixOS";
+      repo = "nixpkgs";
+      ref = "nixos-23.05";
+    };
+
+    crane = {
+      inputs.nixpkgs.follows = "nixpkgs";
+      url = "github:ipetkov/crane";
+    };
+  };
+
+  outputs = { self, nixpkgs, crane }:
+  let supportedSystems = [ "aarch64-linux" "x86_64-linux" ];
+      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
+      nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
+  in {
+    packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in {
+      default = crane.lib.${system}.buildPackage {
+        src = ./.;
+      };
+    });
+
+    devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in {
+      default = pkgs.mkShell {
+        nativeBuildInputs = with pkgs; [
+          cargo
+          rustc
+        ];
+      };
+    });
+  };
+}
+