I noticed that other “helper applications” had issues previously, and have been fixed.
I’d love to fix this myself but I’m still quite new to Nixos, and am not completely familiar with how Cockpit works under the hood with these “plugins”. I did a bit of a comparison between Cockpit on Debian and Nixos and other than a slightly different folder structure, it both included roughly the same executables (in libexec) and the “plugins” do appear in the /nix/store/cockpit-hash/share/cockpit (quite similar to the /usr/share/cockpit/ on Debian).
You can add packages which have that share folder into environment.systemPackages and cockpit will find it. I had to enable that so cockpit would detect it’s core stuff.
In my experience, being the one assigned as maintainer and being the one which introduced it into nixpkgs is that it’s very painful to deal with how cockpit looks for stuff. There are stuff hardcoded everywhere that have to be patched so it doesn’t break. The main definition itself is full of hacks. Upstream is progressively simplifying a lot of stuff tho.
You can try packaging plugins for it and I can even setup the scope thing (I did it once before with the emilua scope) for dependency injection and easier overrides, but I warn you that it will not be a very pleasant experience.
After digging in the Cockpit repository, I found that plugins like Storage and Networking check whether their dependencies (udisks2 and NetworkManager) are installed using the manifest.json in the plugin folders.
This is not pretty however, but I have yet to think of a better way. Ideally this should be handled in the cockpit package itself. I’m glad that the page works now, I even got it to unlock an encrypted ext4 drive. It misses some dependencies in the logs, however;
- Error initializing module 'lvm2': /nix/store/cfikrcdm2jwglzamc3qp65qw2p9pk0c3-udisks-2.10.1/lib/udisks2/modules/libudisks2_lvm2.so: cannot open shared object file: No such file or directory
udisksd
- Error initializing module 'iscsi': /nix/store/cfikrcdm2jwglzamc3qp65qw2p9pk0c3-udisks-2.10.1/lib/udisks2/modules/libudisks2_iscsi.so: cannot open shared object file: No such file or directory
udisksd
- Error initializing module 'btrfs': /nix/store/cfikrcdm2jwglzamc3qp65qw2p9pk0c3-udisks-2.10.1/lib/udisks2/modules/libudisks2_btrfs.so: cannot open shared object file: No such file or directory
Would have to be fixed as well if people tend to use this with other file systems.