assert hostname exists

sh-initrd-on-root
Zynh Ludwig 2024-07-22 00:05:45 -07:00
parent 4edd18ad6c
commit fe7ea07235
1 changed files with 1 additions and 0 deletions

View File

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