From f2332cd872f3b6fcb0d9657d5de4585f28a58039 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 2 Jun 2023 15:29:08 -0400 Subject: [PATCH] chore: set formatter to nixpkgs-fmt --- flake.nix | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 00c9b49..a06ae2a 100644 --- a/flake.nix +++ b/flake.nix @@ -8,8 +8,27 @@ }; }; - outputs = { nixpkgs, ... }: { - nixosModules.catppuccin = import ./modules/nixos nixpkgs; - homeManagerModules.catppuccin = import ./modules/home-manager nixpkgs; - }; + outputs = { nixpkgs, ... }: + let + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + forAllSystems = nixpkgs.lib.genAttrs systems; + nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); + forEachSystem = fn: + forAllSystems (system: + fn { + inherit system; + pkgs = nixpkgsFor.${system}; + }); + in + { + nixosModules.catppuccin = import ./modules/nixos nixpkgs; + homeManagerModules.catppuccin = import ./modules/home-manager nixpkgs; + formatter = forEachSystem ({ pkgs, ... }: pkgs.nixpkgs-fmt); + }; }