add jsonConfig to services
This commit is contained in:
@ -30,7 +30,7 @@
|
||||
enable = true;
|
||||
allowReboot = true;
|
||||
dates = "04:00";
|
||||
flake = "path:/etc/nixos/current";
|
||||
flake = "path:/etc/nixos/current-systemconfig";
|
||||
randomizedDelaySec = "45min";
|
||||
flags = [
|
||||
"--update-input nixpkgs"
|
||||
|
@ -3,6 +3,7 @@
|
||||
config,
|
||||
lib,
|
||||
tier ? "starter",
|
||||
jsonConfig ? {},
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
@ -16,11 +17,16 @@ with lib; let
|
||||
description = "Automation and database tools";
|
||||
};
|
||||
};
|
||||
|
||||
# Helper function to import modules, passing jsonConfig only if needed
|
||||
importService = serviceName: let
|
||||
mod = import ../services/${serviceName};
|
||||
in
|
||||
if isFunction mod
|
||||
then mod {inherit jsonConfig;} # Pass jsonConfig if it's a function
|
||||
else mod; # Use as-is if it's a set
|
||||
in {
|
||||
imports =
|
||||
map
|
||||
(serviceName: import ../services/${serviceName})
|
||||
tiers.${tier}.services;
|
||||
imports = map importService tiers.${tier}.services;
|
||||
|
||||
options.services.selfHostPlaybook = {
|
||||
enable = mkEnableOption "self host playbook";
|
||||
|
Reference in New Issue
Block a user