chore: update flakes

This commit is contained in:
iff 2024-12-11 17:34:15 +01:00
parent 0e82b6aee5
commit 657deb44f3

120
flake.nix
View file

@ -1,69 +1,71 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
}; };
outputs = { self, nixpkgs }: outputs =
let { self, nixpkgs }:
inherit (nixpkgs.lib) let
genAttrs inherit (nixpkgs.lib)
importTOML genAttrs
licenses importTOML
maintainers licenses
sourceByRegex maintainers
; sourceByRegex
;
eachSystem = f: genAttrs eachSystem =
[ f:
"aarch64-darwin" genAttrs [
"aarch64-linux" "aarch64-darwin"
"x86_64-darwin" "aarch64-linux"
"x86_64-linux" "x86_64-darwin"
] "x86_64-linux"
(system: f nixpkgs.legacyPackages.${system}); ] (system: f nixpkgs.legacyPackages.${system});
in in
{ {
formatter = eachSystem (pkgs: pkgs.nixpkgs-fmt); formatter = eachSystem (pkgs: pkgs.nixfmt-rfc-style);
packages = eachSystem (pkgs: packages = eachSystem (
let pkgs:
src = sourceByRegex self [ let
"(core)(/.*)?" src = sourceByRegex self [
"(module-runtime-rules)(/.*)?" "(core)(/.*)?"
"(module-request-ai)(/.*)?" "(module-runtime-rules)(/.*)?"
"(rules)(/.*)?" "(module-request-ai)(/.*)?"
''Cargo\.(toml|lock)'' "(rules)(/.*)?"
]; ''Cargo\.(toml|lock)''
];
inherit (pkgs) inherit (pkgs)
rustPlatform rustPlatform
openssl openssl
pkg-config pkg-config
; ;
in in
{ {
default = default = rustPlatform.buildRustPackage {
rustPlatform.buildRustPackage { pname = "pay-respects";
pname = "pay-respects"; inherit ((importTOML (src + "/core/Cargo.toml")).package) version;
inherit ((importTOML (src + "/core/Cargo.toml")).package) 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 ];
meta = { meta = {
description = "Command suggestions, command-not-found and thefuck replacement written in Rust"; description = "Command suggestions, command-not-found and thefuck replacement written in Rust";
license = licenses.agpl3Plus; license = licenses.agpl3Plus;
homepage = "https://github.com/iffse/pay-respects"; homepage = "https://github.com/iffse/pay-respects";
maintainers = with maintainers; [ iff ]; maintainers = with maintainers; [ iff ];
mainProgram = "pay-respects"; mainProgram = "pay-respects";
}; };
}; };
}); }
}; );
};
} }