diff options
author | Irene Knapp <ireneista@gmail.com> | 2023-03-12 21:36:43 -0700 |
---|---|---|
committer | Irene Knapp <ireneista@gmail.com> | 2023-03-12 21:36:43 -0700 |
commit | b1b668ddaff33c6d5e7ca298675c4f2e6b06f7a1 (patch) | |
tree | f7865584739d39770b537d219fdfd9b62a241e06 | |
parent | 49f760b5657823706503873f3088eb5982932cb4 (diff) |
flake.nix
-rw-r--r-- | flake.nix | 36 |
1 files changed, 36 insertions, 0 deletions
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 + ]; + }; + }); + }; +} |