[URGENT]: treefmt / treefmt-nix dithced

Signed-off-by: s0me1newithhand7s <117505144+s0me1newithhand7s@users.noreply.github.com>
This commit is contained in:
s0me1newithhand7s 2025-10-15 12:11:46 +03:00
parent bb2f60ef95
commit 1726d090c8
No known key found for this signature in database
3 changed files with 26 additions and 44 deletions

View file

@ -2,20 +2,25 @@
name: "Flake Check Action" name: "Flake Check Action"
run-name: "nfc" run-name: "nfc"
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
pull_request: pull_request:
types: [opened,edited,synchronize,reopened] types: [
opened,
edited,
synchronize,
reopened
]
jobs: jobs:
checker: checker:
runs-on: "ubuntu-latest" runs-on: "ubuntu-latest"
steps: steps:
- name: "repo checkout" - name: "Repo checkout"
uses: "actions/checkout@v4" uses: "actions/checkout"
- name: "nix install" - name: "Nix Package Manager install"
uses: "DeterminateSystems/nix-installer-action@v16" uses: "DeterminateSystems/nix-installer-action@v16"
- name: "flake check" - name: "Flake.lock checking"
uses: "DeterminateSystems/flake-checker-action@v5" uses: "DeterminateSystems/flake-checker-action@v5"
- name: "nix fmt" - name: "Formatter run"
run: "nix fmt" run: "nix fmt"

View file

@ -1,30 +0,0 @@
[formatter.alejandra]
command = "alejandra"
options = [
"--experimental-config",
"fmtconf/alejandra.toml",
"--check",
]
includes = [
"."
]
[formatter.statix]
command = "statix"
options = [
"check",
"--config",
"fmtconf/statix.toml",
]
includes = [
"."
]
[formatter.deadnix]
command = "deadnix"
options = [
"--fail",
]
includes = [
"."
]

View file

@ -225,23 +225,30 @@
} @ inputs: { } @ inputs: {
formatter = { formatter = {
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.writeShellApplication { x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.writeShellApplication {
name = "treefmt-nix-lite"; name = "hand7sfmt";
runtimeInputs = with nixpkgs.legacyPackages.x86_64-linux; [ runtimeInputs = with nixpkgs.legacyPackages.x86_64-linux; [
alejandra alejandra
statix statix
deadnix deadnix
treefmt
]; ];
text = '' text = ''
treefmt \ ${nixpkgs.lib.getExe nixpkgs.legacyPackages.x86_64-linux.alejandra} \
--ci \ --experimental-config \
--config-file \ ${self}/.github/workflows/alejandra.toml \
"${self}/.github/workflows/" --check \
${self} && ${nixpkgs.lib.getExe nixpkgs.legacyPackages.x86_64-linux.statix} \
check \
--config \
${self}/.github/workflows/statix.toml \
${self} && ${nixpkgs.lib.getExe nixpkgs.legacyPackages.x86_64-linux.deadnix} \
--fail \
${self}
''; '';
}; };
}; };
homeConfigurations = { homeConfigurations = {
hand7s = home-manager.lib.homeManagerConfiguration { hand7s = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; pkgs = nixpkgs.legacyPackages.x86_64-linux;