nixos: instant more fun

https://github.com/NixOS/nixpkgs/issues/315574
This commit is contained in:
Guanran Wang 2024-06-10 15:22:23 +08:00
parent 96bdbbfb7a
commit 132bc369a0
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
2 changed files with 25 additions and 10 deletions

View file

@ -10,6 +10,7 @@
./hardening ./hardening
./networking ./networking
./nix ./nix
./fun.nix
] ]
++ (with inputs; [ ++ (with inputs; [
aagl.nixosModules.default aagl.nixosModules.default
@ -62,16 +63,6 @@
settings.PasswordAuthentication = false; settings.PasswordAuthentication = false;
}; };
services.getty.greetingLine = let
inherit (config.system) nixos;
in ''
NixOS ${nixos.label} ${nixos.codeName} (\m) - \l
${lib.strings.optionalString (builtins.elem "nvidia" config.services.xserver.videoDrivers)
"--my-next-gpu-wont-be-nvidia"}
${lib.strings.optionalString (builtins.elem "amdgpu" config.boot.initrd.kernelModules)
"[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init"}
'';
users.users = rec { users.users = rec {
"guanranwang" = { "guanranwang" = {
isNormalUser = true; isNormalUser = true;

View file

@ -0,0 +1,24 @@
{
lib,
config,
...
}: {
options = {
system.nixos.codeName = lib.mkOption {readOnly = false;};
};
config = {
# https://github.com/NixOS/nixpkgs/issues/315574
system.nixos.codeName = "";
services.getty.greetingLine = let
inherit (config.system) nixos;
in ''
NixOS ${nixos.label} ${nixos.codeName} (\m) - \l
${lib.strings.optionalString (builtins.elem "nvidia" config.services.xserver.videoDrivers)
"--my-next-gpu-wont-be-nvidia"}
${lib.strings.optionalString (builtins.elem "amdgpu" config.boot.initrd.kernelModules)
"[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init"}
'';
};
}