feat: add node name option

This commit is contained in:
oddlama 2024-01-10 16:11:49 +01:00
parent 7013e9116d
commit 6e0ea91254
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

22
modules/node.nix Normal file
View file

@ -0,0 +1,22 @@
{
config,
lib,
...
}: let
inherit
(lib)
mkOption
types
;
in {
options.node = {
name = mkOption {
description = "A unique name for this node (host) in the repository. Defines the default hostname, but this can be overwritten.";
type = types.str;
};
};
config = {
networking.hostName = config.node.name;
};
}