diff options
-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 + ]; + }; + }); + }; +} |