I’m just started to learn to configure and use NixOS, so maybe I’m still missing some basic concepts and I can’t figure out how to permanently disable systemd services using the configuration file.
After a nixos-rebuild switch it’s fine: the ModemManager.service is shut down. However after a reboot it’s up and running again. Is it possible to preserve the disabled state after a reboot?
I’ve looked around in the manual and also here in discourse but to no avail.
Thanks for your answer!
The service I was asking for is ModemManager, which doesn’t seem to have an option (according to the page, you linked).
A more general question could be: how to make systemctl disable permanent?
I’ve tried it, but in this case, it won’t even stop it on rebuild switch…
Using my original setup, this is the systemctl status output for ModemManager after reboot:
● ModemManager.service - Modem Manager
Loaded: loaded (/nix/store/cd96xz87sp2lvipn6lm22yc5rihy63b2-ModemManager-1.6.8/etc/systemd/system/ModemManager.service; masked; vendor preset: enabled)
Active: active (running) since Thu 2018-05-24 18:51:32 CEST; 2h 20min ago
Main PID: 1175 (ModemManager)
Tasks: 3 (limit: 4915)
CGroup: /system.slice/ModemManager.service
└─1175 /nix/store/cd96xz87sp2lvipn6lm22yc5rihy63b2-ModemManager-1.6.8/sbin/ModemManager
máj 24 18:51:31 nixos systemd[1]: Starting Modem Manager...
máj 24 18:51:32 nixos ModemManager[1175]: <info> ModemManager (version 1.6.8) starting in system bus...
máj 24 18:51:32 nixos systemd[1]: Started Modem Manager.
máj 24 18:51:34 nixos ModemManager[1175]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0': not supported by any plugin
máj 24 18:51:34 nixos ModemManager[1175]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0': not supported by any plugin
máj 24 20:57:07 nixos ModemManager[1175]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0': not supported by any plugin
máj 24 20:57:07 nixos ModemManager[1175]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0': not supported by any plugin
So, it says it is masked. What I do not understand is that, as far as I know, this means that systemd won’t start it even if another service depends on it…
Edit: this is the output after nixos-rebuild switch:
● ModemManager.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)
máj 25 07:21:32 nixos systemd[1]: Starting Modem Manager...
máj 25 07:21:33 nixos ModemManager[1047]: <info> ModemManager (version 1.6.8) starting in system bus...
máj 25 07:21:33 nixos systemd[1]: Started Modem Manager.
máj 25 07:21:35 nixos ModemManager[1047]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0': not supported by any plugin
máj 25 07:21:35 nixos ModemManager[1047]: <info> Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0': not supported by any plugin
máj 25 07:22:44 nixos ModemManager[1047]: <info> Caught signal, shutting down...
máj 25 07:22:44 nixos systemd[1]: Stopping Modem Manager...
máj 25 07:22:44 nixos ModemManager[1047]: <info> ModemManager is shut down
máj 25 07:22:44 nixos systemd[1]: Stopped Modem Manager.