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
dell-command-configure: init at 4.2.0 with module #84926
Conversation
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.
The metadata.maintainers
field doesn't need the extra lib.
but otherwise LGTM
Thanks, fixed up. |
Nice job.
I know the feeling. it is impressive and at the same time very scary :) |
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.
Lgtm
environment.systemPackages = [ pkgs.dell-command-configure ]; | ||
|
||
system.activationScripts.dellCommandConfigure = | ||
'' |
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.
hum I believe activationScript should be avoided as it can easily break things . Also the script creates states as the folders won't be removed afterwards
I am no systemd expert but greping nixpkgs, it can create folders in a way that's more fit.
RuntimeDirectoryPreserve = "yes";
LogsDirectory = subDirs [ "qemu" ];
RuntimeDirectory = subDirs [ "nix-emulators" "nix-helpers" "nix-ovmf" ];
StateDirectory = subDirs [ "dnsmasq" ];
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.
Managing directories with a oneshot systemd unit felt weird, but so did the solution I went for. I guess I would end up here with something like?
ExecStartPre = "mkdir -p /opt/dell/srvadmin/etc";
ExecStart = "ln -fs ${configFile} /opt/dell/srvadmin/etc/omreg.cfg";
LogsDirectory = "openmanage";
StateDirectory = "openmanage";
And remove the configuration options? Though I am unclear on how the symlink and directory would be cleaned up in this case.
As is, this matches how Dell Command Configure is distributed. If openmanage/srvadmin were to be packaged for NixOS, it would be more correct to pull srvadmin-hapi out and have it as a dependency, though I haven't done any testing on whether dcc depends specifically on the version it is distributed with. Latest version of srvadmin-hapi is 9.4.0 The deb and rpm packages additionally come with a systemd service to preload some drivers, but when getting this to work, it was unnecessary to get things to work. As this service works via a complex oneshot shell script I opted to leave it out, but it might prove necessary for some combinations of systems. See: DCC https://www.dell.com/support/article/us/en/19/sln311302/dell-command-configure Documentation https://www.dell.com/support/home/us/en/dedhs1/product-support/product/command-configure-v4.2/docs Openmanage http://linux.dell.com/repo/hardware/omsa.html
Creates the necessary configuration file to launch cctk. The cfg file is mostly undocumented, and while cctk appears to run fine with just `hapi.vardatapath` set, but this is (approximately, minus nix-related changes) what is distributed with the package. The program never actually wrote to those paths in my testing, and appears to operate just fine with only that one variable set, but I did not extensively test every single option, and certainly not across every system that is supported by the software.
Motivation for this change
My motivation here was configuring UEFI/BIOS settings on Dell laptops without rebooting (specifically I wanted to avoid the touchscreen UEFI my XPS 13 has).
I am not confident that the module (specifically the use of
activationScripts
) is the best way to do what's needed.cctk
has no way of specifying where the configuration file is and I couldn't really find a convenient precedent in the nixpkgs repository. Would appreciate help or hints on whether it's possible to improve this!The package I wrote matches the way Dell distributes it, but if Openmanage was packaged for Nix, it would make sense to turn
srvadmin-hapi
into a dependency, and turn the module into a generalopenmanage
module as all related services use the same configuration path. This felt like an ok approach considering the dependency is entirely unusable outside of it right now, and this meets the requirements.If a test for this kind of package is relevant, I would be happy to write one! I'm unsure as to what the best way towards it is though. As this service depends on hardware access, the extent of the test would be running
cctk --Version
really.The package also requires that a UEFI setting be disabled ahead of time (SMM Security Mitigation). I'm not sure if this is something that should be mentioned to the user during installation, or put somewhere in the module description, etc.
Hope the description helps with reviewing :)
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)