Migrate packages to use callPackage pattern
All checks were successful
CI / build (push) Successful in 2m46s

This commit is contained in:
Fabian Hauser 2024-10-19 19:40:58 +03:00
parent 478b8903e0
commit 15ece3585e
11 changed files with 92 additions and 62 deletions

View file

@ -1,17 +1,37 @@
{ system, ... }@inputs:
{
self,
system,
pkgs,
...
}:
with pkgs.lib;
{
${system} =
let
all = import ./all.nix inputs;
packages = pipe (self.lib.foldersWithNix ./.) [
(map (name: {
inherit name;
path = path.append ./. "./${name}/default.nix";
}))
(map (
{ name, path }:
{
inherit name;
value = pkgs.callPackage path {
inherit self;
inherit system;
};
}
))
listToAttrs
];
in
{
inherit all;
default = all;
cache = import ./cache.nix inputs;
deploy-qois = import ./deploy-qois.nix inputs;
docs = import ./docs.nix inputs;
sops = import ./sops.nix inputs;
sops-config = import ./sops-config.nix inputs;
sops-rekey = import ./sops-rekey.nix inputs;
packages
// {
default =
let
nixosConfigs = mapAttrsToList (n: v: v.config.system.build.toplevel) self.nixosConfigurations;
in
pkgs.linkFarmFromDrvs "all" (nixosConfigs ++ (attrValues packages));
};
}