aboutsummaryrefslogtreecommitdiff
path: root/snowfall/modules
diff options
context:
space:
mode:
Diffstat (limited to 'snowfall/modules')
-rw-r--r--snowfall/modules/nixos/system/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/snowfall/modules/nixos/system/default.nix b/snowfall/modules/nixos/system/default.nix
new file mode 100644
index 0000000..a6a570b
--- /dev/null
+++ b/snowfall/modules/nixos/system/default.nix
@@ -0,0 +1,21 @@
+{ options, config, lib, namespace, ... }:
+
+with lib; with lib.${namespace}; let
+ cfg = config.${namespace}.system;
+in {
+ options.${namespace}.system = with types; {
+ hostname = mkOption {
+ type = strMatching "^$|^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$";
+ };
+
+ id = mkOption {
+ default = null;
+ type = nullOr str;
+ };
+ };
+
+ config = {
+ networking.hostName = cfg.hostname;
+ networking.hostId = cfg.id;
+ };
+} \ No newline at end of file