diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..318e03e --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + naersk.url = "github:nix-community/naersk"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { self, flake-utils, naersk, nixpkgs }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = (import nixpkgs) { + inherit system; + }; + + naersk' = pkgs.callPackage naersk {}; + + in rec { + # For `nix build` & `nix run`: + defaultPackage = naersk'.buildPackage { + src = ./.; + }; + + # For `nix develop` (optional, can be skipped): + devShell = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ rustc cargo ]; + }; + } + ); +} \ No newline at end of file |