From 769663d4444d7b004ccb71f507c2a82535cc5234 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 17 Jun 2025 22:07:43 -0400 Subject: add formatter --- flake.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index f80e975..8b44aa8 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,16 @@ let options = import ./options.nix; systems = ["x86_64-linux"]; + perSystem = func: + builtins.listToAttrs (map (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in { + name = system; + value = (func pkgs system); + } + ) systems); + in rec { nixosConfigurations = { shinji = import ./hosts/shinji.nix { inherit inputs options; }; @@ -49,15 +59,14 @@ kaworu = nixosConfigurations.kaworu.config.home-manager.users.${options.user}.home; }; - packages = builtins.listToAttrs (map (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in { - name = system; - value = import ./pkgs { inherit pkgs inputs system options; }; - } - ) systems); + packages = perSystem (pkgs: system: + import ./pkgs { inherit pkgs inputs system options; } + ); legacyPackages = packages; + + formatter = perSystem (pkgs: system: + pkgs.alejandra + ); }; } -- cgit v1.2.3-freya