nixos-config/modules/status-on-console/default.nix

39 lines
888 B
Nix
Raw Normal View History

2020-12-29 04:05:45 +00:00
{ pkgs, ... }:
2020-10-25 08:28:55 +00:00
let
ncfg = pkgs.writeText "neofetch.conf" ''
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution
info "CPU" cpu
info "Memory" memory
info "Disk" disk
info "Local IP" local_ip
# info "Public IP" public_ip
info "Users" users
info cols
}
'';
nscript = pkgs.writeShellScript "neofetch-wrapped" ''
2020-10-26 02:06:13 +00:00
export PATH="$PATH:/run/current-system/sw/bin"
2020-10-25 08:28:55 +00:00
(
${pkgs.neofetch}/bin/neofetch --config "${ncfg}"
echo '\l'
) >/run/issue
'';
in
{
environment.etc.issue.source = pkgs.lib.mkForce "/run/issue";
2020-10-26 01:51:08 +00:00
systemd.services."getty@".serviceConfig.ExecStartPre = "-${nscript}";
2020-10-25 08:28:55 +00:00
}