nix-user-chroot 2.1.1

Install & Run nix without root permissions
Documentation
name: CI
on:
  push:
    branches: [master]
  pull_request:
  merge_group:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: x86_64-unknown-linux-musl
            os: ubuntu-latest
          - target: i686-unknown-linux-musl
            os: ubuntu-latest
          - target: aarch64-unknown-linux-musl
            os: ubuntu-24.04-arm
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}
      - uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}
      - name: Enable unprivileged user namespaces
        run: |
          sudo sysctl -w kernel.unprivileged_userns_clone=1
          sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
      - name: Install busybox for path_config tests
        run: |
          sudo apt-get install -y --no-install-recommends busybox-static
          echo "NIX_USER_CHROOT_TEST_BUSYBOX=$(which busybox)" >> "$GITHUB_ENV"
      - name: Test
        run: cargo test --target ${{ matrix.target }}

  lint:
    name: Linting (fmt + clippy)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings
      - name: Format check
        run: cargo fmt -- --check