Skip to content

Commit

Permalink
nix flake update and github actions for that
Browse files Browse the repository at this point in the history
  • Loading branch information
nyiyui committed Aug 5, 2024
1 parent eaa56fc commit 279a263
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/nix-flake-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: nix flake update
on:
schedule:
- cron: "0 0 * * 5"
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
gitub_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix flake update
- name: commit and push
run: |
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
git add flake.lock
git commit -am "nix flake update"
git push
22 changes: 22 additions & 0 deletions .github/workflows/nixfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: nixfmt
on:
push:

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- run: "nix develop --command nixfmt */*.nix"
- name: commit and push
run: |
if git diff --exit-code; then
echo 'no changes!'
else
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
git add .
git commit -am "nixfmt"
git push
fi
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
nixfmt-rfc-style
govulncheck
nix-prefetch
act
];
};
};
Expand Down

0 comments on commit 279a263

Please sign in to comment.