cooklang-flake/flake.nix
2022-12-30 19:56:26 +01:00

37 lines
1 KiB
Nix

{
description = "Cooklang tools";
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" ];
pkgsFor = system: import nixpkgs { inherit system; };
perSystem = nixpkgs.lib.genAttrs supportedSystems;
mkApp =
{ drv
, name ? drv.pname or drv.name
, exePath ? drv.meta.mainProgram or "bin/${name}"
}: {
type = "app";
program = "${drv}/${exePath}";
};
in
{
packages = perSystem (system:
let
pkgs = pkgsFor system;
in
rec {
cookcli = pkgs.callPackage ./packages/cookcli.nix { };
cook-docs = pkgs.callPackage ./packages/cook-docs.nix { };
default = cookcli;
});
apps = perSystem (system: rec {
cookcli = mkApp {
drv = self.packages.${system}.cookcli;
exePath = "/bin/cook";
};
cook-docs = mkApp { drv = self.packages.${system}.cook-docs; };
default = cookcli;
});
};
}