diff --git a/flake.lock b/flake.lock index 0bf6b9a..7e9d064 100644 --- a/flake.lock +++ b/flake.lock @@ -37,8 +37,7 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "systems": "systems_2" + "nixpkgs": "nixpkgs" } }, "systems": { @@ -55,21 +54,6 @@ "repo": "default", "type": "github" } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 6116473..b155a6d 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,6 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; - systems.url = "github:nix-systems/default"; }; outputs = @@ -12,7 +11,6 @@ self, nixpkgs, flake-utils, - systems, }: { @@ -33,9 +31,27 @@ }; inherit (pkgs) lib; scope = lib.makeScope pkgs.newScope (final: self.overlays.default (pkgs // final) pkgs); + recursePackage = + name: pkg: + let + isDrv = lib.isDerivation pkg; + isAttrs = lib.isAttrs pkg; + in + if isDrv then + [ + (lib.nameValuePair name pkg) + ] + else if isAttrs then + lib.mapAttrsToList (nameNew: subPkg: recursePackage "${name}-${nameNew}" subPkg) pkg + else + [ ]; + flatPackages = builtins.listToAttrs ( + lib.lists.flatten (lib.mapAttrsToList (name: pkg: recursePackage name pkg) scope) + ); workingPackages = lib.filterAttrs (_: pkg: !pkg.meta.broken) self.packages.${system}; in { + inherit flatPackages; inherit pkgs; packages = lib.filterAttrs ( _: pkg: lib.isDerivation pkg && (lib.meta.availableOn pkgs.stdenv.hostPlatform pkg)