From 4da793d37cfd2fd368ed8485cc16df6f8219a12c Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Mon, 18 Nov 2024 15:04:20 +0100 Subject: [PATCH] runs nixfmt --- .github/workflows/nixfmt.yml | 29 +++++++++++++++++++ config/nixos/packages/workstation/flatpak.nix | 7 +++-- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/nixfmt.yml diff --git a/.github/workflows/nixfmt.yml b/.github/workflows/nixfmt.yml new file mode 100644 index 0000000..873a950 --- /dev/null +++ b/.github/workflows/nixfmt.yml @@ -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 diff --git a/config/nixos/packages/workstation/flatpak.nix b/config/nixos/packages/workstation/flatpak.nix index 396c208..71db5a7 100644 --- a/config/nixos/packages/workstation/flatpak.nix +++ b/config/nixos/packages/workstation/flatpak.nix @@ -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 ''; }; -} \ No newline at end of file +}