mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 17:17:22 +01:00
48 lines
1.3 KiB
Nix
48 lines
1.3 KiB
Nix
{ inputs, ... }:
|
|
{
|
|
flake =
|
|
{ config
|
|
, lib
|
|
, ...
|
|
}:
|
|
{
|
|
globals =
|
|
let
|
|
globalsSystem = lib.evalModules {
|
|
prefix = [ "globals" ];
|
|
specialArgs = {
|
|
inherit lib;
|
|
inherit inputs;
|
|
inherit (config) nodes;
|
|
};
|
|
modules = [
|
|
../modules/nixos/common/globals.nix
|
|
(
|
|
{ lib, ... }:
|
|
{
|
|
globals = lib.mkMerge (
|
|
lib.concatLists (
|
|
lib.flip lib.mapAttrsToList config.nodes (
|
|
name: cfg:
|
|
builtins.addErrorContext "while aggregating globals from nixosConfigurations.${name} into flake-level globals:" cfg.config._globalsDefs
|
|
)
|
|
)
|
|
);
|
|
}
|
|
)
|
|
];
|
|
};
|
|
in
|
|
{
|
|
# Make sure the keys of this attrset are trivially evaluatable to avoid infinite recursion,
|
|
# therefore we inherit relevant attributes from the config.
|
|
inherit (globalsSystem.config.globals)
|
|
domains
|
|
services
|
|
macs
|
|
myuser
|
|
root
|
|
;
|
|
};
|
|
};
|
|
}
|