diff options
author | Cara Salter <cara@devcara.com> | 2022-06-09 11:06:36 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-06-09 11:06:36 -0400 |
commit | 7f2bb3c132c9ef65aeb878cf71c14db12c7b801f (patch) | |
tree | 948d23f1939ca897918af43eba40dd643ba8290d /flake.nix | |
download | solarctl-7f2bb3c132c9ef65aeb878cf71c14db12c7b801f.tar.gz solarctl-7f2bb3c132c9ef65aeb878cf71c14db12c7b801f.zip |
Initial commit
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 33 |
1 files changed, 33 insertions, 0 deletions
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 ]; + }; + } + ); +} |