From 94f523638bb2f7ed38ae5924dce21d2d605c8ef0 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Tue, 5 Dec 2023 14:29:55 +0800 Subject: [PATCH] nixos: getty: simplify greetingLine --- nixos/profiles/core/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/nixos/profiles/core/default.nix b/nixos/profiles/core/default.nix index 5c858ac..781dbf4 100644 --- a/nixos/profiles/core/default.nix +++ b/nixos/profiles/core/default.nix @@ -41,15 +41,16 @@ # Services services = { - getty.greetingLine = lib.strings.concatLines [ - ''NixOS ${config.system.nixos.label} ${config.system.nixos.codeName} (\m) - \l'' - - (lib.strings.optionalString config.myFlake.nixos.hardware.components.gpu.nvidia.enable - "--my-next-gpu-wont-be-nvidia") - - (lib.strings.optionalString config.myFlake.nixos.hardware.components.gpu.amd.enable - "[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init") - ]; + getty.greetingLine = let + inherit (config.system) nixos; + inherit (config.myFlake.nixos.hardware.components) gpu; + in '' + NixOS ${nixos.label} ${nixos.codeName} (\m) - \l + ${lib.strings.optionalString gpu.nvidia.enable + "--my-next-gpu-wont-be-nvidia"} + ${lib.strings.optionalString gpu.amd.enable + "[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init"} + ''; openssh = { enable = true;