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

56 lines
1.2 KiB
Nix
Raw Normal View History

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