-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.38 KB
/
guix-nix-policy.yml
File metadata and controls
35 lines (30 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# SPDX-License-Identifier: PMPL-1.0-or-later
name: Guix/Nix Package Policy
on: [push, pull_request]
permissions: read-all
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Enforce Guix primary / Nix fallback
run: |
# Check for package manager files
HAS_GUIX=$(find . -name "*.scm" -o -name ".guix-channel" -o -name "guix.scm" 2>/dev/null | head -1)
HAS_NIX=$(find . -name "*.nix" 2>/dev/null | head -1)
# Block new package-lock.json, yarn.lock, Gemfile.lock, etc.
NEW_LOCKS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E 'package-lock\.json|yarn\.lock|Gemfile\.lock|Pipfile\.lock|poetry\.lock|cargo\.lock' || true)
if [ -n "$NEW_LOCKS" ]; then
echo "⚠️ Lock files detected. Prefer Guix manifests for reproducibility."
fi
# Prefer Guix, fallback to Nix
if [ -n "$HAS_GUIX" ]; then
echo "✅ Guix package management detected (primary)"
elif [ -n "$HAS_NIX" ]; then
echo "✅ Nix package management detected (fallback)"
else
echo "ℹ️ Consider adding guix.scm or flake.nix for reproducible builds"
fi
echo "✅ Package policy check passed"