this repo has no description
0
fork

Configure Feed

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

dev: switch to using treefmt

+69 -24
+22 -1
flake.lock
··· 304 304 "nci": "nci", 305 305 "nixpkgs": "nixpkgs", 306 306 "parts": "parts", 307 - "pre-commit-hooks": "pre-commit-hooks" 307 + "pre-commit-hooks": "pre-commit-hooks", 308 + "treefmt": "treefmt" 308 309 } 309 310 }, 310 311 "rust-overlay": { ··· 335 336 "original": { 336 337 "owner": "nix-systems", 337 338 "repo": "default", 339 + "type": "github" 340 + } 341 + }, 342 + "treefmt": { 343 + "inputs": { 344 + "nixpkgs": [ 345 + "nixpkgs" 346 + ] 347 + }, 348 + "locked": { 349 + "lastModified": 1689620039, 350 + "narHash": "sha256-BtNwghr05z7k5YMdq+6nbue+nEalvDepuA7qdQMAKoQ=", 351 + "owner": "numtide", 352 + "repo": "treefmt-nix", 353 + "rev": "719c2977f958c41fa60a928e2fbc50af14844114", 354 + "type": "github" 355 + }, 356 + "original": { 357 + "owner": "numtide", 358 + "repo": "treefmt-nix", 338 359 "type": "github" 339 360 } 340 361 }
+47 -23
flake.nix
··· 21 21 parts.follows = "parts"; 22 22 }; 23 23 }; 24 + # Universal formatting 25 + treefmt = { 26 + url = "github:numtide/treefmt-nix"; 27 + inputs.nixpkgs.follows = "nixpkgs"; 28 + }; 24 29 }; 25 30 26 31 outputs = inputs: 27 - inputs.parts.lib.mkFlake { inherit inputs; } { 28 - imports = [ inputs.nci.flakeModule inputs.pre-commit-hooks.flakeModule ]; 29 - systems = 30 - [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ]; 31 - perSystem = { config, pkgs, lib, ... }: { 32 + inputs.parts.lib.mkFlake {inherit inputs;} { 33 + imports = [ 34 + inputs.nci.flakeModule 35 + inputs.pre-commit-hooks.flakeModule 36 + inputs.treefmt.flakeModule 37 + ]; 38 + systems = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"]; 39 + perSystem = { 40 + config, 41 + pkgs, 42 + lib, 43 + ... 44 + }: { 32 45 nci = { 33 46 projects.cmprss.relPath = ""; 34 - crates.cmprss = { export = true; }; 47 + crates.cmprss = {export = true;}; 35 48 }; 36 49 packages.default = config.nci.outputs.cmprss.packages.release; 37 50 38 - pre-commit.settings = { 39 - hooks = { 51 + treefmt = { 52 + projectRootFile = ./flake.nix; 53 + programs = { 54 + # Format nix files using alejandra 55 + alejandra.enable = true; 56 + 57 + # Format Markdown/css/etc 58 + # The settings are contained in .prettierrc.yaml 59 + prettier.enable = true; 60 + 40 61 # Format rust files using rustfmt 41 62 rustfmt.enable = true; 63 + }; 64 + }; 42 65 43 - # Ensure no clippy warnings exist 44 - # FIXME: Re-enable. Fails due to mismatched compiler versions because of the devToolchain 45 - #clippy.enable = true; 66 + pre-commit = { 67 + # Can't run in `nix flake check` due to the sandbox 68 + check.enable = false; 69 + settings = { 70 + settings.treefmt.package = config.treefmt.build.wrapper; 71 + hooks = { 72 + treefmt.enable = true; 46 73 47 - # Runs `cargo check` to look for errors 48 - # FIXME: Re-enable. Fails due to network errors in the sandbox. 49 - #cargo-check.enable = true; 74 + # Ensure no clippy warnings exist 75 + # FIXME: Re-enable. Fails for unknown reasons 76 + #clippy.enable = true; 50 77 51 - # Format nix files using nixfmt 52 - # This hook will format the files for you, so on a failure all 53 - # that's needed to fix is to re-run the commit. 54 - nixfmt.enable = true; 55 - 56 - # Format Markdown/css/etc 57 - # The settings are contained in .prettierrc.yaml 58 - prettier.enable = true; 78 + # Runs `cargo check` to look for errors 79 + cargo-check.enable = true; 80 + }; 59 81 }; 60 82 }; 61 83 62 - devShells.default = config.nci.outputs.cmprss.devShell.overrideAttrs 84 + devShells.default = 85 + config.nci.outputs.cmprss.devShell.overrideAttrs 63 86 (old: { 64 87 name = "cmprss"; 65 88 shellHook = '' ··· 67 90 ''; 68 91 nativeBuildInputs = with pkgs; [ 69 92 act # For running Github Actions locally 93 + config.treefmt.build.wrapper # `treefmt` to format everything 70 94 nodePackages.prettier 71 95 rust-analyzer 72 96 ];