assert hostname exists

This commit is contained in:
Zynh Ludwig 2024-07-22 00:05:45 -07:00
parent 4edd18ad6c
commit fe7ea07235

View file

@ -31,6 +31,7 @@ rec {
configHost = if builtins.stringLength configHostname > 0 then configHostname else hostname;
hostStr = lib.strings.optionalString (builtins.stringLength hostname > 0) "@${hostname}";
in
assert lib.assertMsg (builtins.stringLength configHost > 0) "either configHostname or hostname need to exist";
{
name = "${user}${hostStr}";
value = inputs.home-manager.lib.homeManagerConfiguration {