cooklang-flake/flake.nix

38 lines
1.0 KiB
Nix
Raw Normal View History

2022-12-30 19:43:37 +01:00
{
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;
});
};
}