Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
backport:
name: Backport Pull Request
if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event.action != 'labeled' || startsWith(github.event.label.name, 'backport'))
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
steps:
# Use a GitHub App to create the PR so that CI gets triggered
# The App is scoped to Repository > Contents and Pull Requests: write for Nixpkgs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-cherry-picks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions: {}
jobs:
check:
name: cherry-pick-check
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

nixos:
name: fmt-check
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: get-merge-commit
if: needs.get-merge-commit.outputs.mergedSha
steps:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/check-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
include:
- runner: ubuntu-24.04
system: x86_64-linux
- runner: ubuntu-24.04-arm
system: aarch64-linux
- runner: macos-13
system: x86_64-darwin
- runner: macos-14
system: aarch64-darwin

Expand All @@ -30,4 +34,4 @@ jobs:
- uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31

- name: Build shell
run: nix-build shell.nix
run: nix-build ci -A shell
4 changes: 2 additions & 2 deletions .github/workflows/codeowners-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# Check that code owners is valid
check:
name: Check
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: get-merge-commit
if: github.repository_owner == 'NixOS' && needs.get-merge-commit.outputs.mergedSha
steps:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# Request reviews from code owners
request:
name: Request
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
if: github.repository_owner == 'NixOS'
steps:
- uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eval-aliases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

eval-aliases:
name: Eval nixpkgs with aliases enabled
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: [ get-merge-commit ]
steps:
- name: Check out the PR at the test merge commit
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

attrs:
name: Attributes
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: get-merge-commit
if: needs.get-merge-commit.outputs.mergedSha
outputs:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:

outpaths:
name: Outpaths
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: [ attrs, get-merge-commit ]
strategy:
fail-fast: false
Expand All @@ -70,10 +70,10 @@ jobs:
steps:
- name: Enable swap
run: |
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo fallocate -l 10G /swap
sudo chmod 600 /swap
sudo mkswap /swap
sudo swapon /swap

- name: Download the list of all attributes
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:

process:
name: Process
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: [ outpaths, attrs, get-merge-commit ]
outputs:
targetRunId: ${{ steps.targetRunId.outputs.targetRunId }}
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
# Use the target branch to get accurate maintainer info
nix-build target/ci -A eval.compare \
--arg beforeResultDir ./targetResult \
--arg afterResultDir $(realpath prResult) \
--arg afterResultDir "$(realpath prResult)" \
--arg touchedFilesJson ./touched-files.json \
-o comparison

Expand All @@ -212,7 +212,7 @@ jobs:
# Separate job to have a very tightly scoped PR write token
tag:
name: Tag
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: [ attrs, process ]
if: needs.process.outputs.targetRunId
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/get-merge-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: {}

jobs:
resolve-merge-commit:
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
outputs:
mergedSha: ${{ steps.merged.outputs.mergedSha }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
labels:
name: label-pr
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
if: "github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip treewide]')"
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:

- name: Building Nixpkgs lib-tests
run: |
nix-build --arg pkgs "(import ./ci/. {}).pkgs" ./lib/tests/release.nix
nix-build ci -A lib-tests
7 changes: 0 additions & 7 deletions .github/workflows/lint-actions.sh

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/manual-nixos-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
strategy:
fail-fast: false
matrix:
system:
- x86_64-linux
- aarch64-linux
runs-on: >-
${{ (matrix.system == 'x86_64-linux' && 'ubuntu-24.04')
|| (matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm') }}
include:
- runner: ubuntu-24.04
system: x86_64-linux
- runner: ubuntu-24.04-arm
system: aarch64-linux
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -46,7 +46,7 @@ jobs:

- name: Build NixOS manual
id: build-manual
run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true nixos/release.nix -A manual.${{ matrix.system }}
run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true ci -A manual-nixos --argstr system ${{ matrix.system }}

- name: Upload NixOS manual
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/manual-nixpkgs-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- 'doc/**'
- 'lib/**'
- 'pkgs/tools/nix/nixdoc/**'
- 'pkgs/by-name/ni/nixdoc/**'

permissions: {}

jobs:
nixpkgs:
name: nixpkgs-manual-build
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -32,4 +32,4 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Building Nixpkgs manual
run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true pkgs/top-level/release.nix -A manual -A manual.tests
run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true ci -A manual-nixpkgs -A manual-nixpkgs-tests
25 changes: 4 additions & 21 deletions .github/workflows/nix-parse-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,20 @@ jobs:

tests:
name: nix-files-parseable-check
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs: get-merge-commit
if: "needs.get-merge-commit.outputs.mergedSha && !contains(github.event.pull_request.title, '[skip treewide]')"
steps:
- name: Get list of changed files from PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
repos/${{ github.repository }}/pulls/${{github.event.number}}/files --paginate \
| jq --raw-output '.[] | select(.status != "removed" and (.filename | endswith(".nix"))) | .filename' \
> "$HOME/changed_files"
if [[ -s "$HOME/changed_files" ]]; then
echo "CHANGED_FILES=$HOME/changed_files" > "$GITHUB_ENV"
fi

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ needs.get-merge-commit.outputs.mergedSha }}
if: ${{ env.CHANGED_FILES && env.CHANGED_FILES != '' }}

- uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31
with:
extra_nix_config: sandbox = true
nix_path: nixpkgs=channel:nixpkgs-unstable

- name: Parse all changed or added nix files
- name: Parse all nix files
run: |
ret=0
while IFS= read -r file; do
out="$(nix-instantiate --parse "$file")" || { echo "$out" && ret=1; }
done < "$HOME/changed_files"
exit "$ret"
if: ${{ env.CHANGED_FILES && env.CHANGED_FILES != '' }}
# Tests multiple versions at once, let's make sure all of them run, so keep-going.
nix-build ci -A parse --keep-going
2 changes: 1 addition & 1 deletion .github/workflows/no-channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
startsWith(github.event.pull_request.base.ref, 'nixos-') ||
startsWith(github.event.pull_request.base.ref, 'nixpkgs-')
name: "This PR is targeting a channel branch"
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
steps:
- run: |
cat <<EOF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/periodic-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
merge:
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
name: ${{ inputs.from }} → ${{ inputs.into }}
steps:
# Use a GitHub App to create the PR so that CI gets triggered
Expand Down
14 changes: 14 additions & 0 deletions ci/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ let
# By default it's info, which is too noisy since we have many unmatched files
settings.on-unmatched = "debug";

programs.actionlint.enable = true;

programs.keep-sorted.enable = true;

# This uses nixfmt-rfc-style underneath,
Expand Down Expand Up @@ -79,4 +81,16 @@ in
requestReviews = pkgs.callPackage ./request-reviews { };
codeownersValidator = pkgs.callPackage ./codeowners-validator { };
eval = pkgs.callPackage ./eval { };

# CI jobs
lib-tests = import ../lib/tests/release.nix { inherit pkgs; };
manual-nixos = (import ../nixos/release.nix { }).manual.${system} or null;
manual-nixpkgs = (import ../pkgs/top-level/release.nix { }).manual;
manual-nixpkgs-tests = (import ../pkgs/top-level/release.nix { }).manual.tests;
parse = pkgs.lib.recurseIntoAttrs {
latest = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.latest; };
lix = pkgs.callPackage ./parse.nix { nix = pkgs.lix; };
minimum = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.minimum; };
};
shell = import ../shell.nix { inherit nixpkgs system; };
}
43 changes: 43 additions & 0 deletions ci/parse.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
lib,
nix,
runCommand,
}:
let
nixpkgs =
with lib.fileset;
toSource {
root = ../.;
fileset = (fileFilter (file: file.hasExt "nix") ../.);
};
in
runCommand "nix-parse-${nix.name}"
{
nativeBuildInputs = [
nix
];
}
''
export NIX_STORE_DIR=$TMPDIR/store
export NIX_STATE_DIR=$TMPDIR/state

cd "${nixpkgs}"

# Passes all files to nix-instantiate at once.
# Much faster, but will only show first error.
parse-all() {
find . -type f -iname '*.nix' | xargs -P $(nproc) nix-instantiate --parse >/dev/null 2>/dev/null
}

# Passes each file separately to nix-instantiate with -n1.
# Much slower, but will show all errors.
parse-each() {
find . -type f -iname '*.nix' | xargs -n1 -P $(nproc) nix-instantiate --parse >/dev/null
}

if ! parse-all; then
parse-each
fi

touch $out
''
2 changes: 1 addition & 1 deletion nixos/tests/scion/freestanding-deployment/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ../../make-test-python.nix (
networkConfig.Address = "192.168.1.${toString hostId}/24";
};
environment.etc = {
"scion/topology.json".source = ./topology${toString hostId}.json;
"scion/topology.json".source = ./topology + "${toString hostId}.json";
"scion/crypto/as".source = trust-root-configuration-keys + "/AS${toString hostId}";
"scion/certs/ISD42-B1-S1.trc".source = trust-root-configuration-keys + "/ISD42-B1-S1.trc";
"scion/keys/master0.key".text = "U${toString hostId}v4k23ZXjGDwDofg/Eevw==";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/make-binary-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let
runCommand "make-binary-wrapper-test-${testname}" env ''
mkdir -p tmp/foo # for the chdir test

source=${./${testname}}
source=${./. + "/${testname}"}

params=$(<"$source/${testname}.cmdline")
eval "makeCWrapper /send/me/flags $params" > wrapper.c
Expand Down