ark/lib/mkFlake/default.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

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