{
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
fenix,
nixpkgs,
crane,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
fenixToolchain =
with fenix.packages.${system};
complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
];
craneLib = (crane.mkLib pkgs).overrideToolchain fenixToolchain;
lnchr = craneLib.buildPackage {
src = craneLib.cleanCargoSource ./.;
strictDeps = true;
meta = {
description = "A fuzzy terminal app launcher";
homepage = "https://codeberg.org/paul-hartwich/lnchr";
license = pkgs.lib.licenses.mit;
mainProgram = "lnchr";
};
};
in
{
packages = {
default = lnchr;
lnchr = lnchr;
};
apps.default = flake-utils.lib.mkApp { drv = lnchr; };
devShells.default = craneLib.devShell {
packages = with fenix.packages.${system}; [
rust-analyzer
];
};
}
);
}