nixos-config/.github/workflows/pr.yml

57 lines
2.5 KiB
YAML
Raw Normal View History

2022-05-18 20:24:55 +00:00
name: Pull request diff
on:
pull_request:
branches:
- main
jobs:
diff-expr:
name: Diff nix expressions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
2022-11-16 15:36:45 +00:00
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
2023-01-16 16:53:11 +00:00
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs= cache:6tx18bfuH66LOfrn37EmN2YxwNZI3qNk3lKHoz/XlXI=
2022-11-16 15:36:45 +00:00
experimental-features = nix-command flakes ca-derivations
post-build-hook = ${{ github.workspace }}/scripts/post-build-hook
2023-01-16 16:53:11 +00:00
substituters = https://cache.chir.rs/ https://cache.nixos.org/ https://attic.chir.rs/cache
- name: Download patched nix
run: nix build github:DarkKirb/nix-packages#nix-s3-dedup
2023-01-16 16:53:11 +00:00
- name: Download attic
run: nix build github:DarkKirb/nix-packages#attic-client
2022-11-16 16:06:53 +00:00
- name: Set up secrets
run: |
echo "$NIX_CACHE_KEY" > ~/cache.key
sudo mkdir /root/.aws
echo "$AWS_CREDENTIALS" | sudo tee /root/.aws/credentials > /dev/null
2023-01-16 16:53:11 +00:00
nix run github:DarkKirb/nix-packages#attic-client -- login attic-server https://attic.chir.rs/ "$ATTIC_TOKEN"
2022-11-16 16:06:53 +00:00
env:
NIX_CACHE_KEY: ${{secrets.NIX_CACHE_KEY}}
AWS_CREDENTIALS: ${{secrets.AWS_CREDENTIALS}}
2023-01-16 16:53:11 +00:00
ATTIC_TOKEN: ${{secrets.ATTIC_TOKEN}}
2022-05-18 20:24:55 +00:00
- run: |
2022-05-27 06:53:05 +00:00
flake.lock: Update Flake lock file updates: • Updated input 'haskell-flake': 'github:srid/haskell-flake/4fc511d93a55fedf815c1647ad146c26d7a2054e' (2022-11-11) → 'github:srid/haskell-flake/54334cfae9bbb73732bbb1437260017044f68d0b' (2022-12-19) • Updated input 'home-manager': 'github:nix-community/home-manager/37713c6b04b963d41664e03576f73a18c9b0d224' (2022-12-18) → 'github:nix-community/home-manager/e7eba9cc46547ae86642ad3c6a9a4fb22c07bc26' (2022-12-19) • Updated input 'nix-packages': 'github:DarkKirb/nix-packages/6b944ce1d1b4ceca1bc71e3aa060922bd2040856' (2022-12-16) → 'github:DarkKirb/nix-packages/21a1e883fc8855d606601d0736573b36617d789e' (2022-12-20) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/e462a4baf75eeac639b4942481759de08a3bc94e' (2022-12-16) → 'github:NixOS/nixos-hardware/25010a042c23695ae457a97aad60e9b1d49f2ecc' (2022-12-19) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/c4ae266de959fb5a48a210bfc7ee16030a558638' (2022-12-19) → 'github:NixOS/nixpkgs/3014c6792181eba45af6d6e282bb5819044c4367' (2022-12-20) • Updated input 'nur': 'github:nix-community/NUR/9d70eeafc6cc2f97c5b769058d12631d74a994e3' (2022-12-19) → 'github:nix-community/NUR/1c62de16ff1c1f4e10172af163a28a7430fe2d0e' (2022-12-20) • Updated input 'prismmc': 'github:PrismLauncher/PrismLauncher/11c8237d8bddbf1fe371f6bc6c2cbc9f07e66e51' (2022-12-18) → 'github:PrismLauncher/PrismLauncher/8c194cd245c7cf0431a7dfcba1aea5b4eee0304b' (2022-12-19) • Updated input 'prismmc/flake-compat': 'github:edolstra/flake-compat/b4a34015c698c7793d592d66adbab377907a2be8' (2022-04-19) → 'github:edolstra/flake-compat/009399224d5e398d03b22badca40a37ac85412a1' (2022-11-17) • Removed input 'prismmc/tomlplusplus' • Updated input 'sops-nix': 'github:Mic92/sops-nix/da98a111623101c64474a14983d83dad8f09f93d' (2022-12-04) → 'github:Mic92/sops-nix/32840f16ffa0856cdf9503a8658f2dd42bf70342' (2022-12-19)
2022-12-20 08:18:36 +00:00
for job in nixos-8gb-fsn1-1.x86_64-linux nutty-noon.x86_64-linux thinkrac.x86_64-linux nas.x86_64-linux instance-20221213-1915.aarch64-linux; do
nix show-derivation -r "github:DarkKirb/nixos-config/main#hydraJobs.$job" > old-$job.json
2022-05-27 06:53:05 +00:00
done
2022-05-18 20:24:55 +00:00
echo "Difference between this PR and main:" > review
echo "" >> review
flake.lock: Update Flake lock file updates: • Updated input 'haskell-flake': 'github:srid/haskell-flake/4fc511d93a55fedf815c1647ad146c26d7a2054e' (2022-11-11) → 'github:srid/haskell-flake/54334cfae9bbb73732bbb1437260017044f68d0b' (2022-12-19) • Updated input 'home-manager': 'github:nix-community/home-manager/37713c6b04b963d41664e03576f73a18c9b0d224' (2022-12-18) → 'github:nix-community/home-manager/e7eba9cc46547ae86642ad3c6a9a4fb22c07bc26' (2022-12-19) • Updated input 'nix-packages': 'github:DarkKirb/nix-packages/6b944ce1d1b4ceca1bc71e3aa060922bd2040856' (2022-12-16) → 'github:DarkKirb/nix-packages/21a1e883fc8855d606601d0736573b36617d789e' (2022-12-20) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/e462a4baf75eeac639b4942481759de08a3bc94e' (2022-12-16) → 'github:NixOS/nixos-hardware/25010a042c23695ae457a97aad60e9b1d49f2ecc' (2022-12-19) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/c4ae266de959fb5a48a210bfc7ee16030a558638' (2022-12-19) → 'github:NixOS/nixpkgs/3014c6792181eba45af6d6e282bb5819044c4367' (2022-12-20) • Updated input 'nur': 'github:nix-community/NUR/9d70eeafc6cc2f97c5b769058d12631d74a994e3' (2022-12-19) → 'github:nix-community/NUR/1c62de16ff1c1f4e10172af163a28a7430fe2d0e' (2022-12-20) • Updated input 'prismmc': 'github:PrismLauncher/PrismLauncher/11c8237d8bddbf1fe371f6bc6c2cbc9f07e66e51' (2022-12-18) → 'github:PrismLauncher/PrismLauncher/8c194cd245c7cf0431a7dfcba1aea5b4eee0304b' (2022-12-19) • Updated input 'prismmc/flake-compat': 'github:edolstra/flake-compat/b4a34015c698c7793d592d66adbab377907a2be8' (2022-04-19) → 'github:edolstra/flake-compat/009399224d5e398d03b22badca40a37ac85412a1' (2022-11-17) • Removed input 'prismmc/tomlplusplus' • Updated input 'sops-nix': 'github:Mic92/sops-nix/da98a111623101c64474a14983d83dad8f09f93d' (2022-12-04) → 'github:Mic92/sops-nix/32840f16ffa0856cdf9503a8658f2dd42bf70342' (2022-12-19)
2022-12-20 08:18:36 +00:00
for job in nixos-8gb-fsn1-1.x86_64-linux nutty-noon.x86_64-linux thinkrac.x86_64-linux nas.x86_64-linux instance-20221213-1915.aarch64-linux; do
nix show-derivation -r ".#hydraJobs.$job" > new-$job.json
2022-05-27 06:53:05 +00:00
echo "## Changes for $job:" >> review
echo '```' >> review
python scripts/diff-drvs.py old-$job.json new-$job.json >> review
echo '```' >> review
2022-05-18 20:24:55 +00:00
done
2022-11-16 16:06:53 +00:00
mv review .github/workflows
2022-05-18 20:24:55 +00:00
- uses: harupy/comment-on-pr@master
env:
2022-11-16 16:06:53 +00:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-05-18 20:24:55 +00:00
with:
filename: review