Allow flaky installation with darwin-rebuild
This commit is contained in:
parent
f70f90c422
commit
5288a72354
11 changed files with 105 additions and 116 deletions
63
.github/workflows/test.yml
vendored
63
.github/workflows/test.yml
vendored
|
|
@ -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
|
||||
- name: Install nix-darwin
|
||||
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
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue