Nix: add cross-build package

This commit is contained in:
Mihai Fufezan 2024-06-11 18:21:15 +03:00
parent 0f30f9eca6
commit 1419520d5f
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
3 changed files with 13 additions and 3 deletions

View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1713537308, "lastModified": 1717974879,
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", "narHash": "sha256-GTO3C88+5DX171F/gVS3Qga/hOs/eRMxPFpiHq2t+D8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f", "rev": "c7b821ba2e1e635ba5a76d299af62821cbcb09f3",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -18,6 +18,12 @@
localSystem.system = system; localSystem.system = system;
overlays = with self.overlays; [hyprwayland-scanner]; overlays = with self.overlays; [hyprwayland-scanner];
}); });
pkgsCrossFor = eachSystem (system: crossSystem:
import nixpkgs {
localSystem = system;
crossSystem = crossSystem;
overlays = with self.overlays; [hyprwayland-scanner];
});
mkDate = longDate: (lib.concatStringsSep "-" [ mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate) (builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate) (builtins.substring 4 2 longDate)
@ -37,6 +43,7 @@
packages = eachSystem (system: { packages = eachSystem (system: {
default = self.packages.${system}.hyprwayland-scanner; default = self.packages.${system}.hyprwayland-scanner;
inherit (pkgsFor.${system}) hyprwayland-scanner; inherit (pkgsFor.${system}) hyprwayland-scanner;
hyprwayland-scanner-cross = (pkgsCrossFor.${system} "aarch64-linux").hyprwayland-scanner;
}); });
formatter = eachSystem (system: pkgsFor.${system}.alejandra); formatter = eachSystem (system: pkgsFor.${system}.alejandra);

View file

@ -15,6 +15,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config
];
buildInputs = [
pugixml pugixml
]; ];