mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-30 22:57:59 +00:00
Add treefmt for formatting
Which is exactly what's its made for. :)
This commit is contained in:
parent
8d5070a38d
commit
3e09432e6f
33
flake.nix
33
flake.nix
@ -9,17 +9,26 @@
|
|||||||
foo-dogsquared-nixos-config.inputs.flake-utils.follows = "flake-utils";
|
foo-dogsquared-nixos-config.inputs.flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ self, nixpkgs, ... }: let
|
outputs = inputs@{ self, nixpkgs, ... }:
|
||||||
overlays = [
|
let
|
||||||
inputs.foo-dogsquared-nixos-config.overlays.default
|
overlays = [
|
||||||
];
|
inputs.foo-dogsquared-nixos-config.overlays.default
|
||||||
defaultSystem = inputs.flake-utils.lib.system.x86_64-linux;
|
];
|
||||||
systems = with inputs.flake-utils.lib.system; [ defaultSystem ];
|
defaultSystem = inputs.flake-utils.lib.system.x86_64-linux;
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
systems = with inputs.flake-utils.lib.system; [ defaultSystem ];
|
||||||
in {
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
||||||
devShells = forAllSystems (system: let
|
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
|
||||||
in
|
in
|
||||||
{ default = import ./shell.nix { inherit pkgs; }; });
|
{
|
||||||
};
|
devShells = forAllSystems (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
in
|
||||||
|
{ default = import ./shell.nix { inherit pkgs; }; });
|
||||||
|
|
||||||
|
formatter = forAllSystems (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
in
|
||||||
|
pkgs.treefmt);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,19 @@ pkgs.mkShell {
|
|||||||
gnumake
|
gnumake
|
||||||
gnuplot
|
gnuplot
|
||||||
graphviz
|
graphviz
|
||||||
|
jq
|
||||||
lilypond
|
lilypond
|
||||||
|
libcs50
|
||||||
nodejs-16_x
|
nodejs-16_x
|
||||||
octaveFull
|
octaveFull
|
||||||
python3WithPackages
|
python3WithPackages
|
||||||
racket
|
racket
|
||||||
R
|
R
|
||||||
recoll
|
recoll
|
||||||
|
|
||||||
|
# A bunch of formatters...
|
||||||
|
stylua # ...for Lua.
|
||||||
|
rustfmt # ...for Rust.
|
||||||
|
nixpkgs-fmt # ...for Nix.
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
11
treefmt.toml
Normal file
11
treefmt.toml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[formatter.nix]
|
||||||
|
command = "nixpkgs-fmt"
|
||||||
|
includes = [ "*.nix" ]
|
||||||
|
|
||||||
|
[formatter.rust]
|
||||||
|
command = "rustfmt"
|
||||||
|
includes = [ "*.rs" ]
|
||||||
|
|
||||||
|
[formatter.lua]
|
||||||
|
command = "stylua"
|
||||||
|
includes = [ "*.lua" ]
|
Loading…
Reference in New Issue
Block a user