nixos/switch-to-configuration: fix units starting with dash

Fix units starting with `-` being recognized as options.
This commit is contained in:
Weathercold 2022-08-12 18:36:15 -04:00 committed by GitHub
parent 76aa29d2ed
commit 8fb63401af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,7 @@ sub get_active_units {
# Takes the name of the unit as an argument and returns a bool whether the unit is active or not.
sub unit_is_active {
my ($unit_name) = @_;
my $units = busctl_call_systemd1_mgr("ListUnitsByNames", "as", 1, $unit_name)->{data}->[0];
my $units = busctl_call_systemd1_mgr("ListUnitsByNames", "as", 1, , "--", $unit_name)->{data}->[0];
if (scalar(@{$units}) == 0) {
return 0;
}