feat: homelab name
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
config = {
|
||||
host.networking.hostName = "homex";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@ in
|
||||
];
|
||||
options.homelab = with lib; with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = "homelab";
|
||||
};
|
||||
flakeDir = mkOption {
|
||||
type = str;
|
||||
};
|
||||
@@ -41,7 +45,7 @@ in
|
||||
};
|
||||
domain = mkOption {
|
||||
type = either str path;
|
||||
default = "homelab.local";
|
||||
default = "${cfg.name}.local";
|
||||
};
|
||||
localIp = mkOption {
|
||||
type = str;
|
||||
|
||||
@@ -10,6 +10,10 @@ in
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
hostName = mkOption {
|
||||
type = str;
|
||||
default = config.homelab.name;
|
||||
};
|
||||
interface = mkOption {
|
||||
type = str;
|
||||
};
|
||||
@@ -36,6 +40,8 @@ in
|
||||
settings = { };
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
host.networking.hostName = cfg.hostName;
|
||||
|
||||
networking = {
|
||||
dhcpcd.enable = true;
|
||||
interfaces."${cfg.interface}".ipv4.addresses = [{
|
||||
|
||||
Reference in New Issue
Block a user