61 lines
1.4 KiB
Nix
61 lines
1.4 KiB
Nix
|
{
|
||
|
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;
|
||
|
};
|
||
|
};
|
||
|
});
|
||
|
}
|