basic flake

This commit is contained in:
Robin Appelman 2022-06-24 17:02:12 +02:00
commit 81558c1fee
3 changed files with 102 additions and 1 deletions

30
flake.nix Normal file
View file

@ -0,0 +1,30 @@
{
inputs = {
utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
};
outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
in rec {
# `nix build`
packages.palantir = naersk-lib.buildPackage {
pname = "palantir";
root = ./.;
};
defaultPackage = packages.palantir;
# `nix run`
apps.palantir = utils.lib.mkApp {
drv = packages.palantir;
};
defaultApp = apps.palantir;
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo ];
};
});
}