{ lib, pkgs, config, ...}: let inherit (lib) mkOption types; in { options = { hostname = mkOption { description = '' System hostname of the device, as returned by gethostname(2). May or may not correspond to any name it's reachable at on any network. ''; default = "liminix"; type = types.nonEmptyStr; }; hostname-script = mkOption { description = '' Script that outputs the system hostname on stdin. ''; default = pkgs.writeScript "hostname-gen" '' #!/bin/sh echo ${config.hostname} ''; defaultText = '' pkgs.writeScript "hostname-gen" ''' #!/bin/sh echo ''${config.hostname} ''' ''; type = types.package; }; }; }