-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
{nixos/,}cockpit: add branding + small fixes #413033
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
base: master
Are you sure you want to change the base?
Conversation
"cockpit/cockpit.conf".source = settingsFormat.generate "cockpit.conf" cfg.settings; | ||
|
||
# Add "Web console: ..." line to issue and MOTD | ||
"issue.d/cockpit.issue" = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why both?
which service provides this functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue is mostly for agetty: printed before login on TTYs. In agetty(8)
it lists /etc/issue.d
as one of the places it looks for to print issue files (but they must have .issue
extension)
MOTD (message of the day) is for other programs, e.g. those that use PAM for authentication, there is the option security.pam.services.<name>.showMotd
to enable it. Then it will be shown after logging in -- for example if you enable it for the sshd PAM service, it'll show the Cockpit banner when you SSH into the machine. There is a man page pam_motd(8)
that describes it in more detail.
AFAIK default NixOS behavior is to enable issue and disable MOTD. If MOTD is enabled, the banner will show there by default (unless disabled with showBanner = false
).
|
aee7208
to
9052eb6
Compare
Rebased. |
- Add some small NixOS branding and logos - Patch condition paths to fix some apps not displaying - Fix missing hostname in cockpit issue file - Fix reference to Python at runtime, fixes SoS - Allow connections to remote hosts - Add setting to show Cockpit banner in issue and MOTD (enabled by default)
9052eb6
to
97cce6c
Compare
This PR contains a bunch of small tweaks and fixes to the Cockpit package and NixOS module that fix some NixOS-specific bugs and improve the experience of using it overall:
Add some small NixOS branding and logos
This matches the way Cockpit branding is done in other distros, e.g. Fedora, Arch, etc. It's just a logo, favicon, and the OS text "NixOS 12.34 (Whatever)".
Patch condition paths to fix some apps not displaying
Before, it would be checking e.g. for the existence of
/usr/share/...
or/lib/systemd/...
to determine whether to show some applets. This would lead to e.g. Network and Storage applets never showing, even ifNetworkManager
orudisks2
was installed, as they weren't in the FHS paths. I added asubstituteInPlace
call to rewrite those paths to their NixOS counterparts, so now they'll show up if the dependencies are installed:Fix missing hostname in cockpit issue file
Fixes
cockpit-issue.service
failing due to missing hostname command. Now/run/cockpit/issue
will have the proper hostname.Fix reference to Python at runtime, fixes SoS
Before, SoS (
sosreport
, "Diagnostic reports") would load forever even if it was installed. If you opened the browser console, there would be an error about trying to run a Python script to read SoS configuration, but it would fail, because it was trying to execute/usr/libexec/platform-python
. To fix this, I rewrote theplatform-python
reference to point to the Python interpreter in the build inputs. (of course SoS still has to be installed and configured separately)Allow connections to remote hosts
If the
LoginTo
option is not set, Cockpit does some auto-detection to decide whether to show the "Connect to:" prompt. But this would always fail, as SSH wasn't in its path. To fix this,programs.ssh.package
is added tocockpit-ws
's PATH ifLoginTo
is undefined or set to true (so if it's set to false, it won't be added, as it's unnecessary). So by default,LoginTo
will be undefined, SSH will be added to its PATH, and the "Connect to:" field will show. (This matches other distro's behavior too)Add setting to show Cockpit banner in issue and MOTD (enabled by default)
Matches behavior of other distros (e.g. Fedora). Can be disabled with
services.cockpit.showBanner = false
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Maintainer ping: @lucasew
Add a 👍 reaction to pull requests you find important.