I added
systemd.mounts = [{
what = "run-docker-";
where = "run/docker/";
description = "Mount to disable docker spam";
mountConfig = {
UnknownOption = "foo";
LogLevelMax = 0;
};
}];
This caused generation of “/etc/systemd/system/run-docker-.mount” with content
[root@vivy:~]# cat /etc/systemd/system/run-docker-.mount
[Unit]
Description=Mount to disable docker spam
[Mount]
LogLevelMax=0
UnknownOption=foo
What=run-docker-
Where=run/docker/
But, what I want is that the final effect must be creating a directory “/etc/systemd/system/run-docker-.mount.d” containing a file ending with “.conf” containing above content.
I see that there are multiple service.d directories
[root@vivy:~]# ls -ld /etc/systemd/system/*.service.d
dr-xr-xr-x 2 root root 4096 Jan 1 1970 /etc/systemd/system/autovt@.service.d
dr-xr-xr-x 2 root root 4096 Jan 1 1970 /etc/systemd/system/container-getty@.service.d
dr-xr-xr-x 2 root root 4096 Jan 1 1970 /etc/systemd/system/dbus.service.d
...
But I couldn’t find what caused the creation of this directory
on reading https://github.com/NixOS/nixpkgs/blob/fa5e153653a1b48e4a21a14b341e2e01835ba8b5/nixos/modules/services/system/dbus.nix
Q1: How is dbus.service.d directory containing an overrides.conf got generated?
Another solution is creating a custom systemd package, adding the mount.d directory with my own .conf file into the package itself. I believe this might be the cleanest way.
Q2: Is this the best way?