From 89e48b600b01b21c2fae9c6414ddf66e0c38d7a6 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 14 Aug 2025 14:16:56 -0700 Subject: create a project skeleton with a nix flake and a Rust executable I also took the liberty of adding some Rust libraries that I know will be useful Change-Id: Id5d98d86cdce653f6706903b75e285c72f2ba4b4 --- flake.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2c67d17 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + inputs = { + nixpkgs = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-25.05"; + }; + + crane = { + type = "github"; + owner = "ipetkov"; + repo = "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.mkLib pkgs).buildPackage { + src = ./.; + }; + }); + + devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in { + default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + cargo + rustc + ]; + }; + }); + }; +} -- cgit 1.4.1