Created a central place for all common options to all hosts.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.environment;
|
||||
in {
|
||||
options.environment = {
|
||||
ntpServers = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "0.pool.ntp.org" "1.pool.ntp.org" ];
|
||||
description = "NTP servers for this environment.";
|
||||
};
|
||||
|
||||
dnsServers = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "1.1.1.1" "8.8.8.8" ];
|
||||
description = "Authoritative DNS servers for this environment.";
|
||||
};
|
||||
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "example.org";
|
||||
description = "DNS domain for this environment.";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = types.str;
|
||||
default = "UTC";
|
||||
example = "Europe/Paris";
|
||||
description = "Timezone for this environment.";
|
||||
};
|
||||
|
||||
hardwareClock = mkOption {
|
||||
type = types.str;
|
||||
default = "UTC";
|
||||
example = "UTC";
|
||||
description = "Hardware clock setting for this environment.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# System state version — defined once here for all machine types
|
||||
system.stateVersion = "25.11";
|
||||
|
||||
# NTP servers
|
||||
services.ntp.servers = cfg.ntpServers;
|
||||
|
||||
# Time settings
|
||||
time.timeZone = cfg.timeZone;
|
||||
time.hardwareClock = cfg.hardwareClock;
|
||||
|
||||
# Domain and DNS servers
|
||||
networking.domain = cfg.domain;
|
||||
networking.nameServers = cfg.dnsServers;
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ ./../common ];
|
||||
|
||||
# TODO: Add hypervisor-specific configuration
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{ config, modulesPath, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ];
|
||||
imports = [
|
||||
./../common
|
||||
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
||||
];
|
||||
nix.settings = { sandbox = false; };
|
||||
proxmoxLXC = {
|
||||
manageNetwork = false;
|
||||
@@ -43,6 +46,4 @@
|
||||
|
||||
};
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ ./../common ];
|
||||
|
||||
# TODO: Add VM-specific configuration
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ ./../common ];
|
||||
|
||||
# TODO: Add workstation-specific configuration
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user