mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat[server]: use confLib to manage services
This commit is contained in:
parent
fd6df781cf
commit
31623b65d6
37 changed files with 512 additions and 316 deletions
|
|
@ -1,15 +1,24 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems.server) localNetwork;
|
||||
in
|
||||
{
|
||||
options.swarselmodules.server.network = lib.mkEnableOption "enable server network config";
|
||||
options.swarselsystems.server.localNetwork = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "home";
|
||||
};
|
||||
config = lib.mkIf config.swarselmodules.server.network {
|
||||
|
||||
globals.networks.home.hosts.${config.node.name} = {
|
||||
inherit (config.repo.secrets.local.networking.networks.home) id;
|
||||
mac = config.repo.secrets.local.networking.networks.home.mac or null;
|
||||
globals.networks."${if config.swarselsystems.isCloud then config.node.name else "home"}-${localNetwork}".hosts.${config.node.name} = {
|
||||
inherit (config.repo.secrets.local.networking.networks.${localNetwork}) id;
|
||||
mac = config.repo.secrets.local.networking.networks.${localNetwork}.mac or null;
|
||||
};
|
||||
|
||||
globals.hosts.${config.node.name} = {
|
||||
inherit (config.repo.secrets.local.networking) defaultGateway4;
|
||||
wanAddress4 = config.repo.secrets.local.networking.wanAddress4 or null;
|
||||
wanAddress6 = config.repo.secrets.local.networking.wanAddress6 or null;
|
||||
};
|
||||
|
||||
networking = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue