diff --git a/flake.nix b/flake.nix index 9b3fa94..e5693ee 100644 --- a/flake.nix +++ b/flake.nix @@ -9,17 +9,26 @@ foo-dogsquared-nixos-config.inputs.flake-utils.follows = "flake-utils"; }; - outputs = inputs@{ self, nixpkgs, ... }: let - 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 ]; - forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); - in { - devShells = forAllSystems (system: let - pkgs = import nixpkgs { inherit system overlays; }; + outputs = inputs@{ self, nixpkgs, ... }: + let + 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 ]; + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); 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); + }; } diff --git a/shell.nix b/shell.nix index c00c2f4..1fc0502 100644 --- a/shell.nix +++ b/shell.nix @@ -15,12 +15,19 @@ pkgs.mkShell { gnumake gnuplot graphviz + jq lilypond + libcs50 nodejs-16_x octaveFull python3WithPackages racket R recoll + + # A bunch of formatters... + stylua # ...for Lua. + rustfmt # ...for Rust. + nixpkgs-fmt # ...for Nix. ]; } diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..7b9925d --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,11 @@ +[formatter.nix] +command = "nixpkgs-fmt" +includes = [ "*.nix" ] + +[formatter.rust] +command = "rustfmt" +includes = [ "*.rs" ] + +[formatter.lua] +command = "stylua" +includes = [ "*.lua" ]