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); + }; }