From b1b668ddaff33c6d5e7ca298675c4f2e6b06f7a1 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sun, 12 Mar 2023 21:36:43 -0700 Subject: flake.nix --- flake.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0fe9d17 --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + inputs = { + crane = { + url = "github:ipetkov/crane"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, crane, nixpkgs, ... }: + 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 { + pname = "shell"; + version = "0.1"; + + src = ./.; + + meta = { + description = "Shell"; + }; + }; + }); + + devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + cargo + rustc + ]; + }; + }); + }; +} -- cgit 1.4.1