From 7f481e1658581655f251a2cc6bb14a4a5b46044d Mon Sep 17 00:00:00 2001 From: Sam Willcocks Date: Sun, 19 Jun 2022 15:23:36 +0100 Subject: [PATCH] Add alejandra as formatter to add templates --- devshell/flake.nix | 16 ++++++++-------- go/flake.nix | 1 + rust/flake.nix | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/devshell/flake.nix b/devshell/flake.nix index 50e8278..e7ad047 100644 --- a/devshell/flake.nix +++ b/devshell/flake.nix @@ -10,14 +10,14 @@ utils, devshell, }: - utils.lib.eachDefaultSystem (system: { - devShells.default = let - pkgs = import nixpkgs { - inherit system; + utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { + inherit system; - overlays = [devshell.overlay]; - }; - in - pkgs.devshell.mkShell {packages = with pkgs; [];}; + overlays = [devshell.overlay]; + }; + in { + devShells.default = pkgs.devshell.mkShell {packages = with pkgs; [];}; + formatter = pkgs.alejandra; }); } diff --git a/go/flake.nix b/go/flake.nix index 72704bd..2947f1f 100644 --- a/go/flake.nix +++ b/go/flake.nix @@ -34,5 +34,6 @@ devShells.default = pkgs.devshell.mkShell {packages = with pkgs; [go gopls];}; + formatter = pkgs.alejandra; }); } diff --git a/rust/flake.nix b/rust/flake.nix index fb5a68f..419b247 100644 --- a/rust/flake.nix +++ b/rust/flake.nix @@ -45,5 +45,6 @@ pkgs.devshell.mkShell { packages = with pkgs; [(rust.override {extensions = ["rls"];})]; }; + formatter = pkgs.alejandra; }); }