forked from Bos55/nix-config
refactor: optimize flake.nix and modularize networking config
Cleaner deploy.nodes generation, improved devShell experience, and centralized host IP definitions using utils.lib.system variables.
This commit is contained in:
parent
5a031b48ed
commit
f8ed707253
13 changed files with 182 additions and 48 deletions
|
|
@ -1,4 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./networking.nix
|
||||
./secrets.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
homelab = {
|
||||
services.openssh.enable = true;
|
||||
|
|
|
|||
19
modules/common/networking.nix
Normal file
19
modules/common/networking.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.homelab.networking = {
|
||||
hostIp = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The primary IP address of the host.
|
||||
Used for automated deployment and internal service discovery.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.homelab.networking.hostIp != null) {
|
||||
# If a hostIp is provided, we can potentially use it to configure
|
||||
# networking interfaces or firewall rules automatically here in the future.
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue