2021-04-19 05:29:28 +02:00
|
|
|
{ lib, deploy }:
|
2021-03-30 20:10:58 +02:00
|
|
|
let
|
2021-04-19 05:29:28 +02:00
|
|
|
inherit (lib) os;
|
2021-03-30 20:10:58 +02:00
|
|
|
in
|
|
|
|
|
2021-04-19 05:00:49 +02:00
|
|
|
_: { self, inputs, nixos, ... } @ args:
|
2021-03-30 20:10:58 +02:00
|
|
|
let
|
|
|
|
|
2021-04-19 05:29:28 +02:00
|
|
|
cfg = (
|
|
|
|
lib.mkFlake.evalOldArgs
|
2021-04-24 03:13:03 +02:00
|
|
|
{ inherit self inputs args; }
|
2021-04-19 05:29:28 +02:00
|
|
|
).config;
|
2021-03-30 20:10:58 +02:00
|
|
|
|
2021-04-19 05:00:49 +02:00
|
|
|
multiPkgs = os.mkPkgs
|
2021-04-24 03:13:03 +02:00
|
|
|
{
|
|
|
|
inherit self inputs nixos;
|
|
|
|
inherit (cfg) extern overrides;
|
|
|
|
};
|
2021-03-30 20:10:58 +02:00
|
|
|
|
|
|
|
outputs = {
|
2021-04-19 05:00:49 +02:00
|
|
|
nixosConfigurations = os.mkHosts
|
|
|
|
{
|
2021-04-24 03:13:03 +02:00
|
|
|
inherit self inputs nixos multiPkgs;
|
2021-04-19 05:00:49 +02:00
|
|
|
inherit (cfg) extern suites overrides;
|
|
|
|
dir = cfg.hosts;
|
|
|
|
};
|
2021-03-30 20:10:58 +02:00
|
|
|
|
2021-04-24 03:13:03 +02:00
|
|
|
homeConfigurations = os.mkHomeConfigurations self.nixosConfigurations;
|
2021-03-30 20:10:58 +02:00
|
|
|
|
|
|
|
nixosModules = cfg.modules;
|
|
|
|
|
|
|
|
homeModules = cfg.userModules;
|
|
|
|
|
|
|
|
overlay = cfg.packages;
|
|
|
|
inherit (cfg) overlays;
|
|
|
|
|
2021-04-24 03:13:03 +02:00
|
|
|
deploy.nodes = os.mkNodes deploy self.nixosConfigurations;
|
2021-03-30 20:10:58 +02:00
|
|
|
};
|
|
|
|
|
2021-04-18 03:56:24 +02:00
|
|
|
systemOutputs = lib.eachDefaultSystem (system:
|
2021-03-30 20:10:58 +02:00
|
|
|
let
|
|
|
|
pkgs = multiPkgs.${system};
|
2021-04-18 03:35:05 +02:00
|
|
|
pkgs-lib = lib.pkgs-lib.${system};
|
2021-03-30 20:10:58 +02:00
|
|
|
# all packages that are defined in ./pkgs
|
2021-04-24 03:13:03 +02:00
|
|
|
legacyPackages = os.mkPackages {
|
|
|
|
inherit pkgs;
|
|
|
|
inherit (self) overlay overlays;
|
|
|
|
};
|
2021-03-30 20:10:58 +02:00
|
|
|
in
|
|
|
|
{
|
2021-04-10 19:59:10 +02:00
|
|
|
checks = pkgs-lib.tests.mkChecks {
|
2021-04-24 03:13:03 +02:00
|
|
|
inherit (self.deploy) nodes;
|
|
|
|
hosts = self.nixosConfigurations;
|
|
|
|
homes = self.homeConfigurations;
|
2021-04-10 19:59:10 +02:00
|
|
|
};
|
2021-03-30 20:10:58 +02:00
|
|
|
|
|
|
|
inherit legacyPackages;
|
2021-04-18 03:35:05 +02:00
|
|
|
packages = lib.filterPackages system legacyPackages;
|
2021-03-30 20:10:58 +02:00
|
|
|
|
2021-04-10 19:59:10 +02:00
|
|
|
devShell = pkgs-lib.shell;
|
2021-03-30 20:10:58 +02:00
|
|
|
});
|
|
|
|
in
|
2021-04-10 03:22:08 +02:00
|
|
|
outputs // systemOutputs
|
2021-03-30 20:10:58 +02:00
|
|
|
|