my over complex system configurations dotfiles.isabelroses.com/
nixos nix flake dotfiles linux
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

flake: remove treemfmt-nix for our own wrapper

isabel 9e5117ba a32e544c

+103 -77
+1 -22
flake.lock
··· 461 461 "nixpkgs": "nixpkgs", 462 462 "simple-nixos-mailserver": "simple-nixos-mailserver", 463 463 "systems": "systems", 464 - "tgirlpkgs": "tgirlpkgs", 465 - "treefmt-nix": "treefmt-nix" 464 + "tgirlpkgs": "tgirlpkgs" 466 465 } 467 466 }, 468 467 "rust-overlay": { ··· 542 541 "original": { 543 542 "owner": "tgirlcloud", 544 543 "repo": "pkgs", 545 - "type": "github" 546 - } 547 - }, 548 - "treefmt-nix": { 549 - "inputs": { 550 - "nixpkgs": [ 551 - "nixpkgs" 552 - ] 553 - }, 554 - "locked": { 555 - "lastModified": 1750931469, 556 - "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", 557 - "owner": "numtide", 558 - "repo": "treefmt-nix", 559 - "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", 560 - "type": "github" 561 - }, 562 - "original": { 563 - "owner": "numtide", 564 - "repo": "treefmt-nix", 565 544 "type": "github" 566 545 } 567 546 }
-8
flake.nix
··· 156 156 repo = "nix-homebrew"; 157 157 }; 158 158 159 - # a tree-wide formatter 160 - treefmt-nix = { 161 - type = "github"; 162 - owner = "numtide"; 163 - repo = "treefmt-nix"; 164 - inputs.nixpkgs.follows = "nixpkgs"; 165 - }; 166 - 167 159 ### misc 168 160 # declarative theme management 169 161 catppuccin = {
-1
modules/flake/checks/default.nix
··· 2 2 imports = [ 3 3 ./lib.nix 4 4 ./formatting.nix 5 - ./lint.nix 6 5 ]; 7 6 }
+12 -1
modules/flake/checks/formatting.nix
··· 1 + { self, ... }: 1 2 { 2 - perSystem.treefmt.flakeCheck = true; 3 + perSystem = 4 + { pkgs, self', ... }: 5 + { 6 + checks.formatting = 7 + pkgs.runCommandNoCCLocal "formatting-checks" { nativeBuildInputs = [ self'.formatter ]; } 8 + '' 9 + cd ${self} 10 + treefmt --no-cache --fail-on-change 11 + touch $out 12 + ''; 13 + }; 3 14 }
+2 -2
modules/flake/checks/lib.nix
··· 87 87 result, 88 88 }: 89 89 builtins.readFile ( 90 - pkgs.runCommand "nix-flake-tests-error" 90 + pkgs.runCommandNoCCLocal "nix-flake-tests-error" 91 91 { 92 92 expected = formatValue expected; 93 93 result = formatValue result; ··· 109 109 if res != [ ] then 110 110 builtins.throw (lib.strings.concatStringsSep "\n" (map resultToString (lib.debug.traceValSeq res))) 111 111 else 112 - pkgs.runCommand "nix-flake-tests-success" { } "echo > $out"; 112 + pkgs.runCommandNoCCLocal "nix-flake-tests-success" { } "echo > $out"; 113 113 }; 114 114 }
-13
modules/flake/checks/lint.nix
··· 1 - { self, ... }: 2 - { 3 - perSystem = 4 - { pkgs, ... }: 5 - { 6 - checks = { 7 - actionlint = pkgs.runCommand "actionlint" { buildInputs = [ pkgs.actionlint ]; } '' 8 - actionlint ${self}/.github/workflows/** 9 - touch $out 10 - ''; 11 - }; 12 - }; 13 - }
+87 -29
modules/flake/programs/formatter.nix
··· 1 - { inputs, ... }: 1 + { lib, ... }: 2 2 { 3 - imports = [ inputs.treefmt-nix.flakeModule ]; 4 - 5 3 perSystem = 6 4 { pkgs, config, ... }: 7 5 { 8 - formatter = config.treefmt.build.wrapper; 6 + formatter = pkgs.treefmt.withConfig { 7 + runtimeInputs = with pkgs; [ 8 + # keep-sorted start 9 + actionlint 10 + deadnix 11 + keep-sorted 12 + nixfmt-rfc-style 13 + shellcheck 14 + shfmt 15 + statix 16 + stylua 17 + taplo 18 + # keep-sorted end 9 19 10 - treefmt = { 11 - projectRootFile = "flake.nix"; 20 + (writeShellScriptBin "statix-fix" '' 21 + for file in "$@"; do 22 + ${lib.getExe statix} fix "$file" 23 + done 24 + '') 25 + ]; 12 26 13 - programs = { 14 - shellcheck.enable = true; 15 - taplo.enable = true; 16 - # TODO: configure this to not be ugly 17 - # yamlfmt.enable = true; 27 + settings = { 28 + on-unmatched = "info"; 29 + tree-root-file = "flake.nix"; 18 30 19 - just.enable = true; 31 + formatter = { 32 + # keep-sorted start block=yes newline_separated=yes 33 + actionlint = { 34 + command = "actionlint"; 35 + includes = [ 36 + ".github/workflows/*.yml" 37 + ".github/workflows/*.yaml" 38 + ]; 39 + }; 20 40 21 - deadnix.enable = true; 22 - statix.enable = true; 23 - nixfmt = { 24 - enable = true; 25 - package = pkgs.nixfmt-rfc-style; 26 - }; 41 + deadnix = { 42 + command = "deadnix"; 43 + includes = [ "*.nix" ]; 44 + }; 27 45 28 - prettier = { 29 - enable = true; 30 - package = pkgs.prettierd; 31 - excludes = [ "*.age" ]; 32 - settings = { 33 - editorconfig = true; 46 + keep-sorted = { 47 + command = "keep-sorted"; 48 + includes = [ "*" ]; 49 + }; 50 + 51 + nixfmt = { 52 + command = "nixfmt"; 53 + includes = [ "*.nix" ]; 34 54 }; 35 - }; 36 55 37 - stylua.enable = true; 56 + shellcheck = { 57 + command = "shellcheck"; 58 + includes = [ 59 + "*.sh" 60 + "*.bash" 61 + # direnv 62 + "*.envrc" 63 + "*.envrc.*" 64 + ]; 65 + }; 38 66 39 - shfmt = { 40 - enable = true; 41 - indent_size = 2; 67 + shfmt = { 68 + command = "shfmt"; 69 + options = [ 70 + "-s" 71 + "-w" 72 + "-i" 73 + "2" 74 + ]; 75 + includes = [ 76 + "*.sh" 77 + "*.bash" 78 + # direnv 79 + "*.envrc" 80 + "*.envrc.*" 81 + ]; 82 + }; 83 + 84 + statix = { 85 + command = "statix-fix"; 86 + includes = [ "*.nix" ]; 87 + }; 88 + 89 + stylua = { 90 + command = "stylua"; 91 + includes = [ "*.lua" ]; 92 + }; 93 + 94 + taplo = { 95 + command = "taplo"; 96 + options = "format"; 97 + includes = [ "*.toml" ]; 98 + }; 99 + # keep-sorted end 42 100 }; 43 101 }; 44 102 };
+1 -1
modules/flake/programs/shell.nix
··· 24 24 inputs'.agenix.packages.agenix # secrets 25 25 ]; 26 26 27 - inputsFrom = [ config.treefmt.build.devShell ]; 27 + inputsFrom = [ self'.formatter ]; 28 28 }; 29 29 30 30 nixpkgs = pkgs.mkShellNoCC {