nixos: getty: simplify greetingLine

This commit is contained in:
Guanran Wang 2023-12-05 14:29:55 +08:00
parent b572732783
commit 94f523638b
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -41,15 +41,16 @@
# Services # Services
services = { services = {
getty.greetingLine = lib.strings.concatLines [ getty.greetingLine = let
''NixOS ${config.system.nixos.label} ${config.system.nixos.codeName} (\m) - \l'' inherit (config.system) nixos;
inherit (config.myFlake.nixos.hardware.components) gpu;
(lib.strings.optionalString config.myFlake.nixos.hardware.components.gpu.nvidia.enable in ''
"--my-next-gpu-wont-be-nvidia") NixOS ${nixos.label} ${nixos.codeName} (\m) - \l
${lib.strings.optionalString gpu.nvidia.enable
(lib.strings.optionalString config.myFlake.nixos.hardware.components.gpu.amd.enable "--my-next-gpu-wont-be-nvidia"}
"[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init") ${lib.strings.optionalString gpu.amd.enable
]; "[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init"}
'';
openssh = { openssh = {
enable = true; enable = true;