-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thanks getchoo :3
- Loading branch information
Showing
2 changed files
with
10 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,11 @@ | ||
{ | ||
self, | ||
inputs, | ||
lib, | ||
... | ||
}: { | ||
perSystem = { | ||
lib, | ||
pkgs, | ||
system, | ||
... | ||
}: { | ||
packages = let | ||
overlay = lib.fix (final: (import ./exprs/overlay.nix final pkgs)); | ||
|
||
# do not include a package if it's not available on the system or if it's broken | ||
isValid = _: v: | ||
lib.elem pkgs.system (v.meta.platforms or [pkgs.system]) && !(v.meta.broken or false); | ||
in | ||
lib.filterAttrs isValid overlay; | ||
flake.hydraJobs = let | ||
mapCfgsToDerivs = lib.mapAttrs (_: cfg: cfg.activationPackage or cfg.config.system.build.toplevel); | ||
in { | ||
nixosConfigurations = mapCfgsToDerivs self.nixosConfigurations; | ||
}; | ||
|
||
flake.ghaMatrix.include = let | ||
inherit (inputs.nixpkgs) lib; | ||
|
||
platforms = { | ||
"x86_64-linux" = { | ||
os = "ubuntu-latest"; | ||
}; | ||
}; | ||
in | ||
lib.pipe platforms [ | ||
builtins.attrNames # get systems | ||
(systems: lib.getAttrs systems self.packages) # get packages of each system | ||
(lib.mapAttrs (_: builtins.attrNames)) # keep only the name of each package | ||
|
||
# map each package in each system to an attrset | ||
(lib.mapAttrsToList (system: | ||
builtins.map (pkg: { | ||
inherit (platforms.${system}) os; | ||
pkg = "packages.${system}.${pkg}"; | ||
}))) | ||
|
||
lib.flatten | ||
]; | ||
} |