mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-10 21:40:08 +01:00
flake.nix: fix build and make the derivation more maintainable (github #21)
This commit is contained in:
parent
229802cb93
commit
fab8dffbb5
2 changed files with 12 additions and 17 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
/target
|
||||
result
|
||||
|
|
|
|||
28
flake.nix
28
flake.nix
|
|
@ -10,8 +10,7 @@
|
|||
genAttrs
|
||||
importTOML
|
||||
licenses
|
||||
maintainers
|
||||
sourceByRegex
|
||||
cleanSource
|
||||
;
|
||||
|
||||
eachSystem =
|
||||
|
|
@ -29,39 +28,34 @@
|
|||
packages = eachSystem (
|
||||
pkgs:
|
||||
let
|
||||
src = sourceByRegex self [
|
||||
"(core)(/.*)?"
|
||||
"(module-runtime-rules)(/.*)?"
|
||||
"(module-request-ai)(/.*)?"
|
||||
"(rules)(/.*)?"
|
||||
''Cargo\.(toml|lock)''
|
||||
];
|
||||
cargoPackage = (importTOML (src + "/core/Cargo.toml")).package;
|
||||
|
||||
src = cleanSource self;
|
||||
|
||||
inherit (pkgs)
|
||||
rustPlatform
|
||||
openssl
|
||||
pkg-config
|
||||
versionCheckHook
|
||||
;
|
||||
in
|
||||
{
|
||||
default = rustPlatform.buildRustPackage {
|
||||
pname = "pay-respects";
|
||||
inherit ((importTOML (src + "/core/Cargo.toml")).package) version;
|
||||
pname = cargoPackage.name;
|
||||
inherit (cargoPackage) version;
|
||||
|
||||
inherit src;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = src + "/Cargo.lock";
|
||||
};
|
||||
cargoLock.lockFile = src + "/Cargo.lock";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ openssl ];
|
||||
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
meta = {
|
||||
description = "Command suggestions, command-not-found and thefuck replacement written in Rust";
|
||||
inherit (cargoPackage) description homepage;
|
||||
license = licenses.agpl3Plus;
|
||||
homepage = "https://github.com/iffse/pay-respects";
|
||||
maintainers = with maintainers; [ iff ];
|
||||
mainProgram = "pay-respects";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue