bangs/flake.nix

61 lines
1.4 KiB
Nix
Raw Normal View History

2021-05-02 09:35:21 +02:00
{
description = "A web service to evaluate DuckDuckGo-style bangs in search queries";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }: {
overlay = final: prev: {
bang-evaluator = prev.buildGoModule {
name = "bang-evaluator";
src = self;
subPackages = [ "." ];
vendorSha256 = "11r1l5lcdfm3wymrkbddl5khpjmr30jln31l40mfyyy9msnqayf3";
preBuild = ''go generate ./...'';
doCheck = false; # no tests (yet?)
meta = with prev.lib; {
license = licenses.mit;
maintainer = with mainatiners; [ sbruder ];
};
};
};
nixosModules.bang-evaluator = {
imports = [ ./module.nix ];
nixpkgs.overlays = [
self.overlay
];
};
} // flake-utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
in
rec {
packages = {
inherit (pkgs) bang-evaluator;
};
defaultPackage = packages.bang-evaluator;
defaultApp = {
type = "app";
program = "${packages.bang-evaluator}/bin/evaluator";
};
checks = {
integration-test = import ./test.nix {
inherit nixpkgs system;
inherit (self) nixosModules;
};
};
});
}