pay-respects/flake.nix

72 lines
1.7 KiB
Nix
Raw Normal View History

2024-12-11 16:02:24 +01:00
{
2024-12-11 17:34:15 +01:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
outputs =
{ self, nixpkgs }:
let
inherit (nixpkgs.lib)
genAttrs
importTOML
licenses
maintainers
sourceByRegex
;
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
eachSystem =
f:
genAttrs [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
] (system: f nixpkgs.legacyPackages.${system});
in
{
formatter = eachSystem (pkgs: pkgs.nixfmt-rfc-style);
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
packages = eachSystem (
pkgs:
let
src = sourceByRegex self [
"(core)(/.*)?"
"(module-runtime-rules)(/.*)?"
"(module-request-ai)(/.*)?"
"(rules)(/.*)?"
''Cargo\.(toml|lock)''
];
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
inherit (pkgs)
rustPlatform
openssl
pkg-config
;
in
{
default = rustPlatform.buildRustPackage {
pname = "pay-respects";
inherit ((importTOML (src + "/core/Cargo.toml")).package) version;
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
inherit src;
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
cargoLock = {
lockFile = src + "/Cargo.lock";
};
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
2024-12-11 16:02:24 +01:00
2024-12-11 17:34:15 +01:00
meta = {
description = "Command suggestions, command-not-found and thefuck replacement written in Rust";
license = licenses.agpl3Plus;
homepage = "https://github.com/iffse/pay-respects";
maintainers = with maintainers; [ iff ];
mainProgram = "pay-respects";
};
};
}
);
};
2024-12-11 16:02:24 +01:00
}