Skip to content

nix: 2024-12-25 inputs update #381

nix: 2024-12-25 inputs update

nix: 2024-12-25 inputs update #381

Workflow file for this run

name: Build Nix envs
on:
workflow_dispatch:
pull_request:
paths:
- '**'
- '!*.md'
push:
branches:
- 'master'
paths:
- '**'
- '!*.md'
env:
CACHIX_USER: gfanton
UPDATE_BRANCH: flake-update
jobs:
build-macos-env:
name: Build/cache macOS Nix env
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Setup Cachix
uses: cachix/cachix-action@v15
with:
name: ${{ env.CACHIX_USER }}
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build and switch to nix-darwin env
run: |
# Create /run directory
echo -e "run\tprivate/var/run" | sudo tee -a /etc/synthetic.conf >/dev/null
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t &>/dev/null || true
# Prevent conflict between Cachix installed by workflow and the one installed in the config
nix-env --set-flag priority 1 cachix
# Build and Switch to config
nix build .#darwinConfigurations.githubCI.system
# Build and switch to full config
./result/sw/bin/darwin-rebuild switch --flake .#githubCI
build-linux-env:
name: Build/cache Linux Nix env
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: ${{ env.CACHIX_USER }}
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build and switch to home-manager env
run: |
# Prevent conflict between Cachix installed by workflow and the one installed in the config
nix-env --set-flag priority 1 cachix
# Build and switch to home-manager env
nix build ".#homeConfigurations.githubCI.activationPackage"; ./result/activate