diff --git a/flake.nix b/flake.nix index ffb9747..b22a43c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,23 +1,28 @@ { - description = "My project using flake-utils"; + description = "My project"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; - flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in - { - packages = { - huenicorn = pkgs.callPackage ./huenicorn.nix { }; - default = self.packages.${system}.huenicorn; - }; - } - ); + outputs = { nixpkgs, ... }: + let + inherit (nixpkgs) lib; + + forAllSystems = systems: buildPackages: + lib.genAttrs systems (system: buildPackages nixpkgs.legacyPackages.${system}); + + buildPackages = systems: packageOverrides: + forAllSystems systems ( + pkgs: builtins.mapAttrs (_: pkgs.callPackage ./huenicorn.nix) (packageOverrides pkgs) + ); + + unixPackages = buildPackages lib.platforms.unix (pkgs: { + default = { }; + huenicorn = { }; + }); + in + { + packages = unixPackages; + }; } - -