···33 ../../systems
4455 ./lib # The library used by our configuration
66+ ./checks # tests and checks from our configuration
67 ./shell # Shell environment for this configuration
7889 ./args.nix # Arguments given to this flake
+7-13
modules/flake/shell/formatter.nix
···33 perSystem =
44 { pkgs, ... }:
55 {
66- # The nix formatter checks the files instead of formating them
77- # The formatter is put into a workflow at .tangled/workflows/format.yaml
88-96 formatter = pkgs.treefmt.withConfig {
107 runtimeInputs = with pkgs; [
118 nixfmt # nix formating tool
···18151916 # useful script for statix commands to work
2017 # https://github.com/isabelroses/dotfiles/blob/23c7db61455348653703d32ffdc2135fd045f6b8/modules/flake/programs/formatter.nix#L22C1-L26C14
2121- (writeShellScriptBin "statix-check" ''
1818+ (writeShellScriptBin "statix-fix" ''
2219 for file in "$@"; do
2323- ${lib.getExe statix} check "$file"
2020+ ${lib.getExe statix} fix "$file"
2421 done
2522 '')
2623 ];
···3734 formatter = {
3835 nixfmt = {
3936 command = "nixfmt";
4040- options = "-c"; # Check files instead of formating
4141-4237 includes = [ "*.nix" ];
4338 };
4439···4641 command = "deadnix";
47424843 # Warn if there was any dead nix files
4949- options = [ "--fail" ];
4444+ options = [ "--edit" ];
5045 includes = [ "*.nix" ];
5146 };
52475348 statix = {
5454- command = "statix-check";
4949+ command = "statix-fix";
5550 includes = [ "*.nix" ];
5651 };
5752···7065 command = "shfmt";
7166 options = [
7267 "-s" # simplify the code
7373- "-d" # error out of the changes
6868+ "-w" # write changes if found changes
7469 "-i"
7570 "2" # indent files for 2 spaces
7671 ];
···85808681 taplo = {
8782 command = "taplo";
8888- options = "error";
8383+ options = "format";
8984 includes = [ "*.toml" ];
9085 };
91869287 yamlfmt = {
9388 command = "yamlfmt";
9489 options = [
9595- "-dry"
9696- "-continue_on_error"
9090+ "-formatter"
9791 ];
98929993 includes = [