aux-search/flake.nix
erikarvstedt 46d00f3b43
flake, overlay: Rename package to flake-info (#383)
The package now has the same name as the `app` and the
command (`bin/flake-info`).
2021-12-06 15:01:26 +01:00

48 lines
1.3 KiB
Nix

{
description = "Code behind search.nixos.org";
inputs = {
nixpkgs = { url = "nixpkgs/nixos-unstable"; };
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
mkPackage = path: system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [];
};
in
import path { inherit pkgs; };
packages = system:
{
flake-info = mkPackage ./flake-info system;
frontend = mkPackage ./. system;
};
devShell = system:
nixpkgs.legacyPackages.${system}.mkShell {
inputsFrom = builtins.attrValues (packages system);
NIXPKGS_PANDOC_FILTERS_PATH = "${nixpkgs + "/doc/build-aux/pandoc-filters"}";
};
apps = system:
{
flake-info = {
type = "app";
program = "${(packages system).flake-info}/bin/flake-info";
};
};
in
{
defaultPackage = forAllSystems (mkPackage ./.);
packages = forAllSystems packages;
devShell = forAllSystems devShell;
apps = forAllSystems apps;
defaultApp = forAllSystems (system: (apps system).flake-info);
};
}