mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-11 22:10:09 +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
|
/target
|
||||||
|
result
|
||||||
|
|
|
||||||
28
flake.nix
28
flake.nix
|
|
@ -10,8 +10,7 @@
|
||||||
genAttrs
|
genAttrs
|
||||||
importTOML
|
importTOML
|
||||||
licenses
|
licenses
|
||||||
maintainers
|
cleanSource
|
||||||
sourceByRegex
|
|
||||||
;
|
;
|
||||||
|
|
||||||
eachSystem =
|
eachSystem =
|
||||||
|
|
@ -29,39 +28,34 @@
|
||||||
packages = eachSystem (
|
packages = eachSystem (
|
||||||
pkgs:
|
pkgs:
|
||||||
let
|
let
|
||||||
src = sourceByRegex self [
|
cargoPackage = (importTOML (src + "/core/Cargo.toml")).package;
|
||||||
"(core)(/.*)?"
|
|
||||||
"(module-runtime-rules)(/.*)?"
|
src = cleanSource self;
|
||||||
"(module-request-ai)(/.*)?"
|
|
||||||
"(rules)(/.*)?"
|
|
||||||
''Cargo\.(toml|lock)''
|
|
||||||
];
|
|
||||||
|
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
rustPlatform
|
rustPlatform
|
||||||
openssl
|
openssl
|
||||||
pkg-config
|
pkg-config
|
||||||
|
versionCheckHook
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = rustPlatform.buildRustPackage {
|
default = rustPlatform.buildRustPackage {
|
||||||
pname = "pay-respects";
|
pname = cargoPackage.name;
|
||||||
inherit ((importTOML (src + "/core/Cargo.toml")).package) version;
|
inherit (cargoPackage) version;
|
||||||
|
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock.lockFile = src + "/Cargo.lock";
|
||||||
lockFile = src + "/Cargo.lock";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
nativeBuildInputs = [ pkg-config ];
|
||||||
buildInputs = [ openssl ];
|
buildInputs = [ openssl ];
|
||||||
|
|
||||||
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Command suggestions, command-not-found and thefuck replacement written in Rust";
|
inherit (cargoPackage) description homepage;
|
||||||
license = licenses.agpl3Plus;
|
license = licenses.agpl3Plus;
|
||||||
homepage = "https://github.com/iffse/pay-respects";
|
|
||||||
maintainers = with maintainers; [ iff ];
|
|
||||||
mainProgram = "pay-respects";
|
mainProgram = "pay-respects";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue