diff --git a/flake.lock b/flake.lock index febb002..4469374 100755 --- a/flake.lock +++ b/flake.lock @@ -442,7 +442,8 @@ "rust-overlay": "rust-overlay", "sops-nix": "sops-nix", "spicetify-nix": "spicetify-nix", - "systems": "systems" + "systems": "systems", + "treefmt-nix": "treefmt-nix" } }, "rust-overlay": { @@ -528,6 +529,26 @@ "repo": "default", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709911575, + "narHash": "sha256-yC2iOKe0BSZAeXLNPXPrsGn5BwUTYYZESKb+OblLnXY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "9c57261c71871d2208a6dd4394774cca226c6dbc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index c24d522..f8a2b0c 100755 --- a/flake.nix +++ b/flake.nix @@ -76,6 +76,10 @@ inputs.flake-utils.follows = "flake-utils"; }; systems.url = "github:nix-systems/default"; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; ### De-dupe flake dependencies crane = { @@ -128,8 +132,11 @@ inherit system modules; specialArgs = {inherit inputs;}; }; + + treefmtEval = eachDefaultSystemMap (system: inputs.treefmt-nix.lib.evalModule inputs.nixpkgs.legacyPackages.${system} ./treefmt.nix); in { - formatter = eachDefaultSystemMap (system: inputs.nixpkgs.legacyPackages.${system}.alejandra); + formatter = eachDefaultSystemMap (system: treefmtEval.${system}.config.build.wrapper); + checks = eachDefaultSystemMap (system: {formatting = treefmtEval.${system}.config.build.check inputs.self;}); packages = eachDefaultSystemMap (system: import ./pkgs inputs.nixpkgs.legacyPackages.${system}); overlays = import ./overlays; nixosModules.default = ./nixos/modules; diff --git a/home/applications/firefox/user-overrides.js b/home/applications/firefox/user-overrides.js index 0324d2b..dee861b 100644 --- a/home/applications/firefox/user-overrides.js +++ b/home/applications/firefox/user-overrides.js @@ -31,5 +31,5 @@ user_pref("browser.urlbar.suggest.calculator", true); user_pref("apz.overscroll.enabled", true); user_pref("general.smoothScroll", true); user_pref("general.smoothScroll.msdPhysics.enabled", true); -user_pref("general.smoothScroll.msdPhysics.motionBeginSpringConstant", 600) +user_pref("general.smoothScroll.msdPhysics.motionBeginSpringConstant", 600); user_pref("mousewheel.default.delta_multiplier_y", 75); diff --git a/home/applications/thunderbird/user-overrides.js b/home/applications/thunderbird/user-overrides.js index 4b3ed29..c5120b4 100644 --- a/home/applications/thunderbird/user-overrides.js +++ b/home/applications/thunderbird/user-overrides.js @@ -6,7 +6,6 @@ user_pref("browser.cache.memory.capacity", 1); user_pref("privacy.clearOnShutdown.cache", false); user_pref("mail.imap.use_disk_cache2", true); - // View related. // Makes messages prettier. user_pref("permissions.default.image", 1); diff --git a/treefmt.nix b/treefmt.nix new file mode 100644 index 0000000..5b824e4 --- /dev/null +++ b/treefmt.nix @@ -0,0 +1,19 @@ +{ + projectRootFile = "flake.nix"; + + ### nix + programs.deadnix.enable = true; + programs.statix.enable = true; + programs.alejandra.enable = true; + + ### shell + programs.shellcheck.enable = true; + programs.shfmt.enable = true; + + ### toml + programs.taplo.enable = true; + + ### misc + programs.prettier.enable = true; + settings.formatter.prettier.excludes = ["secrets.yaml"]; +}