New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show IP in login prompt (?) #63322
Comments
my typical solution to this is to |
This is already supported by
But there's no guarantee that DHCP has assigned an address when it runs, and the IP might change later, so you'll want to do
Which works on my machine. |
Are any other linux distributions that are doing this? I know some of the *BSD did, but not sure about linux. |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
#63322 (comment) works. The login took longer to appear. Should we make this a NixOS option (enableIP...) or just document it (where? wiki?)? |
I marked this as stale due to inactivity. → More info |
Still interested in this. |
@573 what solution would you like to have? |
I guess I would prefer to have it as a NixOS option. |
Issue description
I have a NixOS installation without graphical user interface and use DHCP to get an IP.
I have power, ethernet and a display connected to the device.
To connect via ssh, i have to connect a keyboard and type the password to login and get the IP.
It would be helpful to see the primary IP in login prompt!
It's probably not that easy to get the primary IP. On traditional systems the NIC is called eth0, but with systemd, it's called differently on every system. In my case, i use a bridge called br0.
For my nixos-containers, i use
ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
to get the IP.The login help text seem to be defined here: https://github.com/NixOS/nixpkgs/blob/release-19.03/nixos/modules/services/ttys/agetty.nix
Technical details
"x86_64-linux"
Linux 4.19.46, NixOS, 19.03.172758.36516712916 (Koi)
yes
yes
nix-env (Nix) 2.2.2
"nixos-19.03.172883.1601f559e89"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: