pub-solar-os/lib/mkFlake/default.nix

65 lines
1.3 KiB
Nix
Raw Normal View History

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