From ddbfb81fd041af226f4550be741440a01ea07591 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Tue, 12 Mar 2024 18:06:24 -0700 Subject: nix flake, based on my rust flake template --- 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..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 + ]; + }; + }); + }; +} + -- cgit 1.4.1