Skip to content

Update NUR packages #269

Update NUR packages

Update NUR packages #269

# This is a basic workflow to help you get started with Actions
name: Update NUR packages
# this will happen once a week
on:
schedule:
- cron: 0 0 * * 6
workflow_dispatch:
push:
paths:
- '.github/workflows/update-packages.yml'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup fake git account
run: |
git config user.name "Monorepo bot :D"
git config user.email "[email protected]"
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
experimental-features = nix-command flakes
nix_path: nixpkgs=channel:nixpkgs-unstable
# updates niv and javascript dependencies
- name: Update niv dependencies
run: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} nix-shell -p niv --run "niv update"
(cd nix/ && rm -r _sources && $(nix-build --no-out-link ../pkgs -A nvfetcher --arg pkgs "import <nixpkgs> {}")/bin/nvfetcher -c nvfetcher.toml)
- name: Update flakes
run: |
./createFlakeNix.sh
git add -f flake.nix
nix flake update
git rm -f flake.nix
- name: Update JavaScript packages
run: |
nix-env -iA nix-gen-node-tools -f pkgs/default.nix
(cd pkgs && {
mv js old-js
mkdir js
mv old-js/default.nix js/
for i in $(ls old-js/); do
(cd js/ && nix-gen-node-tools $i)
done
rm -rf old-js/
})
- name: Create commit message
run: |
git add .
git commit -m "Automatic update of packages at $(date)"
- name: Push to master
uses: ad-m/[email protected]
with:
github_token: ${{secrets.GITHUB_TOKEN}}