runs nixfmt

This commit is contained in:
Menno van Leeuwen 2024-11-18 15:04:20 +01:00
parent df08e01d9e
commit 4da793d37c
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
2 changed files with 33 additions and 3 deletions

29
.github/workflows/nixfmt.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Nix Format Check
on:
pull_request:
push:
branches: [ main ]
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v25
- name: Install nixfmt
run: nix-env -i nixfmt
- name: Check Nix formatting
run: |
find . -name "*.nix" -type f -exec nixfmt {} \;
if git diff --quiet; then
echo "All Nix files are properly formatted"
else
echo "Error: Some Nix files are not properly formatted"
git diff
exit 1
fi

View File

@ -1,10 +1,11 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
services.flatpak.enable = true;
systemd.services.flatpak-repo = {
wantedBy = [ "multi-user.target" ];
path = [ pkgs.flatpak ];
script = ''
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
'';
};
}