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 = [ "." ];
|
|
|
|
|
2023-12-02 15:24:10 +01:00
|
|
|
vendorHash = "sha256-w3mFra7Je+8qIDQMSyUYucoLZ6GtrZmr56O6xmihIYc=";
|
2021-05-02 09:35:21 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
2021-05-15 10:14:11 +02:00
|
|
|
|
|
|
|
# My hydra only has x86_64-linux builders
|
|
|
|
hydraJobs = if pkgs.lib.elem system [ "x86_64-linux" ]
|
|
|
|
then {
|
|
|
|
build = defaultPackage;
|
|
|
|
integration-test = checks.integration-test;
|
|
|
|
}
|
|
|
|
else { };
|
2021-05-02 09:35:21 +02:00
|
|
|
});
|
|
|
|
}
|