35 lines
881 B
Nix
35 lines
881 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 = ./.;
|
|
buildInputs = with pkgs; [ cmake libiconv ];
|
|
};
|
|
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 ];
|
|
};
|
|
});
|
|
}
|