hydra: fix unfree evaluation

This commit is contained in:
Gabriel Fontes
2023-09-25 11:26:47 -03:00
parent f0818e2695
commit 3d156b8266
2 changed files with 7 additions and 3 deletions
+5 -2
View File
@@ -65,8 +65,11 @@
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
pkgsFor = nixpkgs.legacyPackages;
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs systems (system: import nixpkgs {
inherit system;
config.allowUnfree = true;
});
in
{
inherit lib;
+2 -1
View File
@@ -3,8 +3,9 @@ let
inherit (inputs.nixpkgs.lib) filterAttrs mapAttrs elem;
notBroken = pkg: !(pkg.meta.broken or false);
isDistributable = pkg: (pkg.meta.license or { redistributable = true; }).redistributable;
hasPlatform = sys: pkg: elem sys (pkg.meta.platforms or [ ]);
filterValidPkgs = sys: pkgs: filterAttrs (_: pkg: hasPlatform sys pkg && notBroken pkg) pkgs;
filterValidPkgs = sys: pkgs: filterAttrs (_: pkg: hasPlatform sys pkg && notBroken pkg && isDistributable pkg) pkgs;
getCfg = _: cfg: cfg.config.system.build.toplevel;
in
{