{
description = "taskfinder - Display tasks from plain text files";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, fenix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
rustToolchain = fenix.packages.${system}.latest.toolchain;
cargoToml = pkgs.lib.importTOML ./Cargo.toml;
manifest = cargoToml.package;
binName = (builtins.head cargoToml.bin).name;
cleanDescription = pkgs.lib.removeSuffix "." manifest.description;
package = with pkgs;
rustPlatform.buildRustPackage rec {
pname = manifest.name;
version = manifest.version;
src = fetchFromGitea {
domain = "codeberg.org";
owner = "kdwarn";
repo = "taskfinder";
rev = "v${version}";
hash = "sha256-pEil5W05ALkKtBwRgi44dk9H5P6F2kDnGVzipvr5vGE=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-u8zHTNbVY/IitNOMkUGQxucFbG93hH1EXeIJzllHhso=";
nativeBuildInputs = [ rustToolchain ];
meta = with lib; {
description = cleanDescription;
homepage = manifest.repository;
license = licenses.agpl3Plus;
maintainers = with maintainers; [ Ginner ];
platforms = platforms.all;
mainProgram = binName;
};
};
in
{
packages.default = package;
apps.default = flake-utils.lib.mkApp {
drv = package;
name = binName;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rustToolchain
rust-analyzer
clippy
];
};
}) // {
overlays.default = final: prev: {
taskfinder = self.packages.${prev.system}.default;
};
};
}