11.stylix/flake/dev/default.nix
awwpotato a5c1532ab8
flake: partition dev inputs (#1289)
Link: https://github.com/nix-community/stylix/pull/1289

Reviewed-by: Daniel Thwaites <danth@danth.me>
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2025-07-06 23:56:44 +02:00

84 lines
2.1 KiB
Nix

{
imports = [
./dev-shell.nix
./nixpkgs-and-dev-nixpkgs-version-consistency.nix
./packages.nix
./pre-commit.nix
];
perSystem =
{ pkgs, ... }:
{
# TODO: consider using https://flake.parts/options/treefmt-nix.html
formatter = pkgs.treefmt.withConfig {
runtimeInputs = with pkgs; [
# keep-sorted start
biome
keep-sorted
nixfmt-rfc-style
ruff
stylish-haskell
# keep-sorted end
];
settings = {
on-unmatched = "info";
tree-root-file = "flake.nix";
formatter = {
# keep-sorted start block=yes
biome = {
command = "biome";
options = [
"format"
"--write"
"--no-errors-on-unmatched"
"--config-path"
(pkgs.writers.writeJSON "biome.json" {
formatter = {
indentStyle = "space";
indentWidth = 2;
lineWidth = 80;
};
})
];
includes = [
"*.css"
"*.js"
"*.json"
];
excludes = [
# Contains custom syntax that biome can't handle
"modules/swaync/base.css"
];
};
keep-sorted = {
command = "keep-sorted";
includes = [ "*" ];
};
nixfmt = {
command = "nixfmt";
options = [ "--width=80" ];
includes = [ "*.nix" ];
};
ruff = {
command = "ruff";
options = [
"--config"
(pkgs.writers.writeTOML "ruff.toml" {
line-length = 80;
})
"format"
];
includes = [ "*.py" ];
};
stylish-haskell = {
command = "stylish-haskell";
includes = [ "*.hx" ];
};
# keep-sorted end
};
};
};
};
}