diff options
author | Emile <git@emile.space> | 2023-06-25 23:52:39 +0200 |
---|---|---|
committer | Emile <git@emile.space> | 2023-06-25 23:52:39 +0200 |
commit | 1374b6aa8b292299acc73fb97ecf464799ad5188 (patch) | |
tree | 1c7c9acbdb564572dcc330578f2ff8e4b6cd1543 /flake.nix | |
parent | 23bac78a03991f398ca9b4bb4cf1e66643cba9f3 (diff) |
flakes with naersk
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 |