60 lines
1.6 KiB
Nix
60 lines
1.6 KiB
Nix
{
|
|
description = "QuickPeep Search Engine Flake for Nix";
|
|
|
|
inputs = {
|
|
utils.url = "github:numtide/flake-utils";
|
|
naersk.url = "github:nix-community/naersk";
|
|
src.url = "path:..";
|
|
src.flake = false;
|
|
};
|
|
|
|
outputs = { self, nixpkgs, utils, naersk, src }:
|
|
utils.lib.eachDefaultSystem (system: let
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
naersk-lib = naersk.lib."${system}";
|
|
in rec {
|
|
# `nix build`
|
|
packages.quickpeep = naersk-lib.buildPackage {
|
|
pname = "quickpeep";
|
|
root = src;
|
|
buildInputs = with pkgs; [
|
|
openssl
|
|
pkgconfig
|
|
|
|
];
|
|
nativeBuildInputs = with pkgs; [
|
|
# Idea from https://github.com/NixOS/nixpkgs/blob/634141959076a8ab69ca2cca0f266852256d79ee/pkgs/servers/matrix-conduit/default.nix
|
|
pkgs.rust.packages.stable.rustPlatform.bindgenHook
|
|
];
|
|
|
|
overrideMain = attrs: {
|
|
preConfigure = ''
|
|
export PATH="${pkgs.sqlx-cli}/bin:$PATH"
|
|
pushd quickpeep
|
|
bash dev_db.sh
|
|
popd
|
|
'';
|
|
};
|
|
};
|
|
|
|
defaultPackage = packages.quickpeep;
|
|
|
|
# NixOS Modules
|
|
nixosModules = {
|
|
quickpeepSearch = import ./modules/quickpeepSearch.nix self;
|
|
quickpeepRaker = import ./modules/quickpeepRaker.nix self;
|
|
};
|
|
|
|
# `nix run`
|
|
apps.quickpeep = utils.lib.mkApp {
|
|
drv = packages.quickpeep;
|
|
};
|
|
defaultApp = apps.quickpeep;
|
|
|
|
# `nix develop`
|
|
devShell = pkgs.mkShell {
|
|
nativeBuildInputs = with pkgs; [ rustc cargo ];
|
|
};
|
|
});
|
|
}
|