Skip to content

Commit 2c1016b

Browse files
committed
update
1 parent 94478d5 commit 2c1016b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ jobs:
5757
run: |
5858
# 加载 Nix 环境
5959
. /home/runner/.nix-profile/etc/profile.d/nix.sh
60+
# 设置环境变量以允许非自由包(Gurobi)
61+
export NIXPKGS_ALLOW_UNFREE=1
6062
# 使用 nix flake 构建,利用 flake.nix 中定义的环境
6163
# 启用缓存以提高构建速度
62-
nix build .#docker-image --option sandbox false
64+
nix build .#docker-image --option sandbox false --impure
6365
6466
- name: Set up Docker Buildx
6567
uses: docker/setup-buildx-action@v3
@@ -187,8 +189,7 @@ jobs:
187189
uses: dataaxiom/ghcr-cleanup-action@v1
188190
with:
189191
token: ${{ secrets.GITHUB_TOKEN }}
190-
package-name: ${{ env.IMAGE_NAME }}
191-
keep-versions: 10
192+
package: ${{ env.IMAGE_NAME }}
192193

193194
generate-summary:
194195
runs-on: ubuntu-latest

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
pkgs = import nixpkgs {
2323
inherit system;
2424
overlays = [(import rust-overlay)];
25+
config.allowUnfree = true;
26+
config.allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [ "gurobi" "gurobipy" ];
2527
};
2628
in {
2729
formatter = pkgs.alejandra;

0 commit comments

Comments
 (0)