zat/flake.nix
2022-03-26 10:24:03 -04:00

34 lines
826 B
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
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.zat = naersk-lib.buildPackage {
pname = "zat";
root = ./.;
};
defaultPackage = packages.zat;
# `nix run`
apps.zat = utils.lib.mkApp {
drv = packages.zat;
};
defaultApp = apps.zat;
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo ];
};
});
}