1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

cross updates

This commit is contained in:
Robin Appelman 2023-07-11 21:39:24 +02:00
commit a93e0a0102
4 changed files with 19 additions and 26 deletions

View file

@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- id: set-matrix
run: echo "matrix={\"target\":$(nix eval --json ".#targets.x86_64-linux")}" | tee $GITHUB_OUTPUT
run: echo "matrix={\"target\":$(nix eval --json ".#targets")}" | tee $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest

View file

@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- id: set-matrix
run: echo "matrix=$(nix eval --json ".#releaseMatrix.x86_64-linux")" | tee $GITHUB_OUTPUT
run: echo "matrix={\"target\":$(nix eval --json ".#releaseTargets")}" | tee $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
@ -33,6 +33,6 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: result/bin/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
file: result/bin/haze
asset_name: haze-${{ matrix.target }}
tag: ${{ github.ref }}

6
flake.lock generated
View file

@ -10,11 +10,11 @@
]
},
"locked": {
"lastModified": 1687811683,
"narHash": "sha256-j0+0y2CBlwrbVkVEZajjAy9gdzHRNCq8hQTRe+QXTAQ=",
"lastModified": 1689107909,
"narHash": "sha256-fb+zxf7AWesECHx1foXOM3NcKHLrdeXzGb6s2AhT6pE=",
"owner": "icewind1991",
"repo": "cross-naersk",
"rev": "5e987fcf0521602914773016b173403d0fa873f9",
"rev": "51de54599de569e6faa2ee33dd659c5c028d9911",
"type": "github"
},
"original": {

View file

@ -19,7 +19,17 @@
naersk,
rust-overlay,
cross-naersk,
}:
}: let
inherit (builtins) filter;
inherit (nixpkgs.lib.strings) hasInfix;
targets = [
"x86_64-unknown-linux-gnu"
"x86_64-unknown-linux-musl"
"aarch64-unknown-linux-gnu"
"aarch64-unknown-linux-musl"
];
releaseTargets = filter (hasInfix "-musl") targets;
in
flake-utils.lib.eachDefaultSystem (
system: let
overlays = [(import rust-overlay)];
@ -30,15 +40,8 @@
inherit (pkgs) lib callPackage;
inherit (lib.sources) sourceByRegex;
inherit (lib.attrsets) genAttrs;
inherit (lib.lists) remove;
hostTarget = pkgs.hostPlatform.config;
targets = [
hostTarget
"x86_64-unknown-linux-musl"
"aarch64-unknown-linux-musl"
];
releaseTargets = remove hostTarget targets;
cross-naersk' = callPackage cross-naersk {inherit naersk;};
src = sourceByRegex ./. ["Cargo.*" "(src)(/.*)?"];
@ -70,17 +73,6 @@
default = haze;
};
inherit targets;
releaseMatrix = {
include =
builtins.map (target: {
inherit target;
artifact_name = "haze-${target}";
asset_name = "haze";
})
releaseTargets;
};
devShells = {
default = cross-naersk'.mkShell targets {
nativeBuildInputs = with pkgs; [bacon cargo-edit cargo-outdated clippy];
@ -89,6 +81,7 @@
}
)
// {
inherit targets releaseTargets;
homeManagerModule = import ./hm-module.nix;
};
}