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
70 changes: 70 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: Bug report
about: Report incorrect behavior, regressions, or integration problems
title: "bug: "
labels: [bug]
assignees: []
---

## Summary

What happened?

## Reproduction

Provide the smallest reproduction you can.

```nix
# Minimal flake/module/home-manager snippet if relevant
```

Steps:

1.
2.
3.

## Expected Behavior

What should have happened?

## Actual Behavior

What happened instead?

Include the exact error message if there is one.

```text
paste error output here
```

## Configuration Context

- Deferred Apps mode: `packages` / `apps` / `cliPackages` / `cliApps` / `extraApps`
- Target: `NixOS` / `Home Manager standalone` / `Home Manager on NixOS`
- Package or app name(s):
- `allowUnfree` used?: yes / no / not relevant
- `gcRoot` used?: yes / no
- Custom `flakeRef` used?: yes / no
- Custom `extraApps` overrides used?: yes / no

## Environment

- System: `x86_64-linux`, `aarch64-linux`, etc.
- Nix version:
- NixOS release (if applicable):
- Home Manager release (if applicable):
- Deferred Apps revision/commit:

## Checks

What did you already try?

- [ ] `nix flake check`
- [ ] `nixos-rebuild build` or `home-manager build`
- [ ] reproduced with a minimal configuration
- [ ] checked whether the package works without Deferred Apps

## Additional Context

Anything else that would help diagnose the issue?
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions and design discussion
url: https://github.com/WitteShadovv/deferred-apps/discussions
about: Use Discussions for open-ended questions or early design exploration.
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Feature request
about: Propose a new capability or improvement
title: "feat: "
labels: [enhancement]
assignees: []
---

## Summary

What would you like to add or improve?

## Problem

What limitation or pain point does this solve?

## Proposed Approach

Describe the preferred behavior.

If relevant, include example configuration:

```nix
programs.deferredApps = {
enable = true;
};
```

## Alternatives Considered

What workarounds exist today?

## Impact

Please note any likely impact on:

- module options
- wrapper behavior
- closure size
- documentation
- backward compatibility

## Additional Context

Links, prior art, or related issues.
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Summary

-

## Validation

- [ ] `nix flake check`
- [ ] `statix check .`
- [ ] `deadnix --fail -L .`
- [ ] `nix fmt . -- --check`

## Definition of Done

- [ ] scope is focused and reviewable
- [ ] tests added or updated when behavior changed
- [ ] docs updated for any user-facing change
- [ ] examples and option names match the current implementation
- [ ] no accidental closure-size or dependency regression introduced

## Notes for Reviewers

-
192 changes: 14 additions & 178 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,30 @@ jobs:
permissions:
pull-requests: read
outputs:
nix: ${{ steps.filter.outputs.nix }}
docs: ${{ steps.filter.outputs.docs }}
quality: ${{ steps.filter.outputs.quality }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
nix:
quality:
- '**/*.nix'
- 'flake.lock'
docs:
- '**/*.md'
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/workflows/**'
- 'scripts/**'
- '.pre-commit-config.yaml'

# ===========================================================================
# Core Nix checks - runs flake check which includes module evaluation
# Canonical quality gates for local and CI validation
# ===========================================================================
flake-check:
name: Flake check
quality-gates:
name: Quality gates
needs: changes
if: ${{ needs.changes.outputs.nix == 'true' || github.event_name == 'workflow_dispatch' }}
if: ${{ needs.changes.outputs.quality == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -68,187 +70,21 @@ jobs:
with:
fail-mode: true

- name: Run flake checks
run: nix flake check --print-build-logs

# ===========================================================================
# Code formatting - ensures consistent style
# ===========================================================================
formatting:
name: Check formatting
needs: changes
if: ${{ needs.changes.outputs.nix == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes

- name: Check Nix formatting
run: |
echo "Checking Nix file formatting with nixfmt-rfc-style..."
# Find all .nix files and check formatting
find . -name '*.nix' -type f | xargs nix develop .#ci --command nixfmt --check

# ===========================================================================
# Static analysis - linting and dead code detection
# ===========================================================================
lint:
name: Lint
needs: changes
if: ${{ needs.changes.outputs.nix == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes

- name: Run statix (Nix linter)
run: |
echo "Running statix for Nix lints and suggestions..."
nix develop .#ci --command statix check .

- name: Run deadnix (unused code detector)
run: |
echo "Checking for unused Nix code with deadnix..."
# -L: Don't check lambda attrset pattern names (nixpkgs callPackage compatibility)
nix develop .#ci --command deadnix --fail -L .

# ===========================================================================
# Test suite - comprehensive tests for library, module, and edge cases
# ===========================================================================
test-suite:
name: Test suite
needs: changes
if: ${{ needs.changes.outputs.nix == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes

- name: List all test cases
run: |
echo "Available test cases in tests/ directory:"
nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | sort

- name: Run internal function tests
run: |
echo "Running internal function tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^internal-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All internal function tests passed"

- name: Run library tests
run: |
echo "Running library function tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^lib-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All library tests passed"

- name: Run nested package tests
run: |
echo "Running nested package tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^nested-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All nested package tests passed"

- name: Run collision detection tests
run: |
echo "Running collision detection tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^collision-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All collision detection tests passed"

- name: Run module tests
run: |
echo "Running NixOS module tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^module-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All module tests passed"

- name: Run Home Manager tests
run: |
echo "Running Home Manager module tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^hm-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All Home Manager tests passed"

- name: Run error handling tests
run: |
echo "Running error handling tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^error-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All error handling tests passed"

- name: Run compatibility tests
run: |
echo "Running compatibility tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^compat-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All compatibility tests passed"

- name: Run meta and integration tests
run: |
echo "Running meta and integration tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep -E '^(meta-|integration-)'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All meta and integration tests passed"

- name: Run package mode tests
run: |
echo "Running package mode tests..."
for check in $(nix eval .#checks.x86_64-linux --apply 'checks: builtins.attrNames checks' --json | jq -r '.[]' | grep '^pkg-'); do
echo " Building: $check"
nix build ".#checks.x86_64-linux.$check" --print-build-logs
done
echo "✓ All package mode tests passed"
- name: Run canonical quality gates
run: ./scripts/quality-gates.sh

# ===========================================================================
# Summary job - provides clear status
# ===========================================================================
ci-success:
name: CI Success
needs: [flake-check, formatting, lint, test-suite]
needs: [quality-gates]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.flake-check.result }}" == "failure" ]] || \
[[ "${{ needs.formatting.result }}" == "failure" ]] || \
[[ "${{ needs.lint.result }}" == "failure" ]] || \
[[ "${{ needs.test-suite.result }}" == "failure" ]]; then
if [[ "${{ needs.quality-gates.result }}" == "failure" ]]; then
echo "One or more CI jobs failed"
exit 1
fi
Expand Down
Loading
Loading