File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments