From 0c4df2124f99660ac5abeff698f59fa21038b51f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 14 Dec 2023 12:59:02 -0800 Subject: pre-commit delegates all the work to treefmt Clean up the yaml file for the GHA. --- .github/workflows/update.yml | 35 ++++++++++++++++------------------- flake/devshell.nix | 8 ++++++-- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index b6e407b..4503baa 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,27 +1,24 @@ name: Nix Autoupdater - on: workflow_dispatch: {} schedule: - - cron: '0 0 * * *' - + - cron: "0 0 * * *" jobs: update-packages: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v24 - with: - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - accept-flake-config = true - - run: | - nix shell nixpkgs#git -c git config user.name 'NixBot' - nix shell nixpkgs#git -c git config user.email 'fcuny@users.noreply.github.com' - nix flake update - nix shell nixpkgs#git -c git commit -am "[Auto] update all inputs" - - - name: Commit & Push changes - uses: actions-js/push@v1.4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v24 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + accept-flake-config = true + - run: | + nix shell nixpkgs#git -c git config user.name 'NixBot' + nix shell nixpkgs#git -c git config user.email 'fcuny@users.noreply.github.com' + nix flake update + nix shell nixpkgs#git -c git commit -am "[Auto] update all inputs" + - name: Commit & Push changes + uses: actions-js/push@v1.4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/flake/devshell.nix b/flake/devshell.nix index e641bd3..6e1d40e 100644 --- a/flake/devshell.nix +++ b/flake/devshell.nix @@ -15,8 +15,13 @@ name = "world"; packages = with pkgs; [ + (config.treefmt.build.wrapper) ]; + devshell.startup = { + pre-commit.text = config.pre-commit.installationScript; + }; + commands = [ { package = config.treefmt.build.wrapper; } ]; @@ -30,6 +35,7 @@ programs = { nixpkgs-fmt.enable = true; shfmt.enable = true; + shellcheck.enable = true; yamlfmt.enable = true; taplo.enable = true; }; @@ -39,9 +45,7 @@ settings = { hooks = { # deadnix.enable = true; - shellcheck.enable = true; treefmt.enable = true; - yamlfmt.enable = true; }; }; }; -- cgit 1.4.1