From 4adf4688ec4e8a338ef5d986f1ead59824315d24 Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Fri, 6 Jun 2025 12:08:49 +0200 Subject: [PATCH] Use only supported systems, use home config at top level fixes nix flake check --- flake.nix | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index abb88e1..821936f 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,14 @@ home-manager, ... }: + let + supportedSystems = [ + "x86_64-linux" + "aarch64-darwin" + "aarch64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + in { nixosConfigurations = { laptop = nixpkgs.lib.nixosSystem { @@ -31,23 +39,27 @@ ]; }; }; + homeConfigurations = nixpkgs.lib.foldl' ( + acc: system: + acc + // { + "irl-${system}" = home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { inherit system; }; + modules = [ ./home/irl.nix ]; + }; + "irl-gui-${system}" = home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { inherit system; }; + modules = [ + ./home/irl.nix + { + irl.gui-packages = true; + } + ]; + }; + } + ) { } supportedSystems; } - // flake-utils.lib.eachSystem flake-utils.lib.allSystems (system: { + // flake-utils.lib.eachSystem supportedSystems (system: { formatter = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style; - packages.homeConfigurations = { - irl = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { inherit system; }; - modules = [ ./home/irl.nix ]; - }; - irl-gui = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { inherit system; }; - modules = [ - ./home/irl.nix - { - irl.gui-packages = true; - } - ]; - }; - }; }); }