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