This code doesn't work:
const SYSTEMCTL_PATH: &str = "/usr/bin/systemctl";
With the error Error: No such file or directory (os error 2). This is because /usr/bin/systemctl does not exist in NixOS. systemctl is in the path in NixOS, so it would be better if the default path just called systemctl instead of assuming a certain path for systemctl (/usr/bin should be in path anyways).
This code doesn't work:
With the error
Error: No such file or directory (os error 2). This is because/usr/bin/systemctldoes not exist in NixOS.systemctlis in the path in NixOS, so it would be better if the default path just calledsystemctlinstead of assuming a certain path forsystemctl(/usr/binshould be in path anyways).