From 177147654ce1cfcf82566b4a2c2868e711429921 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Sat, 28 Dec 2024 18:17:20 +0000 Subject: [PATCH] DIO CANE --- flake.nix | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) 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; + }; } - -