From 7f2bb3c132c9ef65aeb878cf71c14db12c7b801f Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 9 Jun 2022 11:06:36 -0400 Subject: Initial commit --- flake.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4390004 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + naersk.url = "github:nix-community/naersk"; + }; + + outputs = { self, nixpkgs, flake-utils, naersk }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = nixpkgs.legacyPackages."${system}"; + naersk-lib = naersk.lib."${system}"; + in + rec { + # `nix build` + packages.hello-world = naersk-lib.buildPackage { + pname = "hello-world"; + root = ./.; + }; + defaultPackage = packages.hello-world; + + # `nix run` + apps.hello-world = flake-utils.lib.mkApp { + drv = packages.hello-world; + }; + defaultApp = apps.hello-world; + + # `nix develop` + devShell = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ rustc cargo ]; + }; + } + ); +} -- cgit v1.2.3