diff --git a/flake.nix b/flake.nix index 7dffbd11..2f23c8c4 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,15 @@ NixOS-WSL, spicetify-nix, ... - } @ inputs: { + } @ inputs: let + supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + + # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + # Nixpkgs instantiated for supported system types. + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); + in { nixosConfigurations = { redyf = nixpkgs.lib.nixosSystem @@ -103,5 +111,18 @@ ]; }; }; + devShells = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + in { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + git + nixpkgs-fmt + statix + ]; + }; + }); + + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; }; }