diff options
| author | Michael Hoang <enzime@users.noreply.github.com> | 2023-06-20 22:54:31 +1000 |
|---|---|---|
| committer | Michael Hoang <enzime@users.noreply.github.com> | 2023-07-11 18:59:05 +1000 |
| commit | 5288a723540fdb25e34364518115e2ef32ed19ad (patch) | |
| tree | 8211ea859315c329a7e374a65cb3c738da5e7027 /.github/workflows | |
| parent | f70f90c42207ede0c3b21b785e2650beeecc161c (diff) | |
Allow flaky installation with `darwin-rebuild`
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/test.yml | 63 |
1 files changed, 26 insertions, 37 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c03bc93..5f0fddb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,28 +119,18 @@ jobs: uses: cachix/install-nix-action@v22 with: install_url: https://github.com/nix-community/nix-unstable-installer/releases/download/nix-2.10.0pre20220822_7c3ab57/install - nix_path: nixpkgs=channel:${{ env.CURRENT_STABLE_CHANNEL }} extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Install ${{ env.CURRENT_STABLE_CHANNEL }} channel - run: | - nix-channel --add https://nixos.org/channels/${{ env.CURRENT_STABLE_CHANNEL }} nixpkgs - nix-channel --update - - name: Install nix-darwin and test result - run: | - export NIX_PATH=$HOME/.nix-defexpr/channels - nix-shell -A installer - nix-shell -A installer.check - - name: Build simple flake configuration + - name: Install nix-darwin run: | - nix build ./modules/examples/flake#darwinConfigurations.simple.system --override-input darwin . - - name: Activate derivation of simple flake build - run: | - ./result/sw/bin/darwin-rebuild switch --flake ./modules/examples/flake#simple --override-input darwin . - - name: Rebuild and activate simple flake, but this time using nix-darwins flake interface + nix run .#darwin-rebuild -- \ + switch --flake ./modules/examples/flake#simple \ + --override-input darwin . \ + --override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} + - name: Rebuild and activate simple flake, but this time using nix-darwin's flake interface run: | . /etc/static/bashrc - darwin-rebuild build --flake ./modules/examples/flake#simple --override-input darwin . + darwin-rebuild build --flake ./modules/examples/flake#simple --override-input darwin . --override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} - name: Test git submodules run: | . /etc/static/bashrc @@ -175,6 +165,7 @@ jobs: darwin-rebuild build \ --flake /tmp/test-nix-darwin-submodules#simple \ --override-input darwin . \ + --override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} \ && { printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr exit 1 @@ -183,6 +174,7 @@ jobs: darwin-rebuild build \ --flake /tmp/test-nix-darwin-submodules?submodules=0#simple \ --override-input darwin . \ + --override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} \ && { printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr exit 1 @@ -191,7 +183,8 @@ jobs: # Should succeed darwin-rebuild build \ --flake /tmp/test-nix-darwin-submodules?submodules=1#simple \ - --override-input darwin . + --override-input darwin . \ + --override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} \ install-flake-against-unstable: runs-on: macos-12 @@ -201,28 +194,18 @@ jobs: - name: Install nix from current unstable channel uses: cachix/install-nix-action@v22 with: - nix_path: nixpkgs=channel:nixpkgs-unstable extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Install nixpkgs-unstable channel + - name: Install nix-darwin run: | - nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs - nix-channel --update - - name: Install nix-darwin and test result - run: | - export NIX_PATH=$HOME/.nix-defexpr/channels - nix-shell -A installer - nix-shell -A installer.check - - name: Build simple flake configuration - run: | - nix build ./modules/examples/flake#darwinConfigurations.simple.system --override-input darwin . - - name: Activate derivation of simple flake build - run: | - ./result/sw/bin/darwin-rebuild switch --flake ./modules/examples/flake#simple --override-input darwin . - - name: Rebuild and activate simple flake, but this time using nix-darwins flake interface + nix run .#darwin-rebuild -- \ + switch --flake ./modules/examples/flake#simple \ + --override-input darwin . \ + --override-input nixpkgs nixpkgs/nixpkgs-unstable + - name: Rebuild and activate simple flake, but this time using nix-darwin's flake interface run: | . /etc/static/bashrc - darwin-rebuild build --flake ./modules/examples/flake#simple --override-input darwin . + darwin-rebuild build --flake ./modules/examples/flake#simple --override-input darwin . --override-input nixpkgs nixpkgs/nixpkgs-unstable - name: Test git submodules run: | . /etc/static/bashrc @@ -257,14 +240,17 @@ jobs: darwin-rebuild build \ --flake /tmp/test-nix-darwin-submodules#simple \ --override-input darwin . \ + --override-input nixpkgs nixpkgs/nixpkgs-unstable \ && { printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr exit 1 } + # Should also fail darwin-rebuild build \ --flake /tmp/test-nix-darwin-submodules?submodules=0#simple \ --override-input darwin . \ + --override-input nixpkgs nixpkgs/nixpkgs-unstable \ && { printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr exit 1 @@ -273,8 +259,11 @@ jobs: # Should succeed darwin-rebuild build \ --flake /tmp/test-nix-darwin-submodules?submodules=1#simple \ - --override-input darwin . + --override-input darwin . \ + --override-input nixpkgs nixpkgs/nixpkgs-unstable + # Should also succeed darwin-rebuild build \ --flake git+file:///tmp/test-nix-darwin-submodules?submodules=1#simple \ - --override-input darwin . + --override-input darwin . \ + --override-input nixpkgs nixpkgs/nixpkgs-unstable |
