nixpkgs/nixos/modules
Maximilian Bosch 8325996621
nixos/autorandr: make default target in systemd service configurable
The `.service` file defining the `systemd` unit for `autorandr.service`
which is bundled with the package itself uses `--default default` in the
`ExecStart` section. This can be an issue when having multiple layouts
(e.g. `default` as workstation layout I mostly work on and `mobile` when
I go somewhere else).

When the service gets restarted and `--default` can't be applied,
however the current layout can't be detected (e.g. when working with an
unknown beamer) the service silently fails with a message like this:

```
Jun 22 18:44:46 hauptshuhle autorandr[3168]: /nix/store/h83b72ffm68nm8fyjnppljchp456a94r-xrandr-1.5.0/bin/xrandr: ca>
Jun 22 18:44:46 hauptshuhle autorandr[3168]: Failed to apply profile 'default' (line 718):
Jun 22 18:44:46 hauptshuhle autorandr[3168]:   Command failed: /nix/store/h83b72ffm68nm8fyjnppljchp456a94r-xrandr-1.>
```

As discussed in the IRC (see https://botbot.me/freenode/nixos/2018-07-05/?msg=101791455&page=6)
it's a bad long-term solution in terms of maintenance to manually patch
the service file bundled with the derivation, instead the service shall
be configured declaratively. Additionally this makes possible overrides
from the user-space way easier.

The `udev` rule (in `$out/etc/udev/rules.d`) won't' be affected, it
simply runs `systemctl start autorandr.service` when e.g. a new display
is added, so now `udev` communicates with the NixOS systemd unit.
2018-07-05 14:39:08 +02:00
..
config nixos/no-x-libs: Switch to using nixpkgs.overlays 2018-06-11 20:58:33 +02:00
hardware brightnessctl: init at 0.3.2 (#42102) 2018-06-16 18:15:42 -04:00
i18n/input-method Added cross-references to NixOS manual 2018-04-12 09:39:14 +10:00
installer not-detected: use lib.mkDefault 2018-06-17 23:25:41 +03:00
misc Revert "nixpkgs module: Fix defaulting of localSystem and system" 2018-05-31 15:55:36 -04:00
profiles nixos/installer: Drop dmraid 2018-05-25 01:55:51 +03:00
programs nixos/thefuck: move init scripts to programs.*.interactiveShellInit 2018-06-22 01:32:11 +02:00
security manual: Clarify that limits.conf doesn't apply to systemd services. (#40267) 2018-05-12 17:44:57 +02:00
services nixos/autorandr: make default target in systemd service configurable 2018-07-05 14:39:08 +02:00
system nixos/stage-1: Make find-libs not choke on dynamic linker being in DT_NEEDED 2018-06-20 17:58:02 +03:00
tasks nixos/zfs: mount AFTER import 2018-06-15 20:58:43 +02:00
testing nixos/tests: set default stateVersion in test VMs 2018-05-14 00:01:15 +02:00
virtualisation azure: stop carrying qemu-220 patch 2018-06-12 02:06:03 -07:00
module-list.nix Merge pull request #41485 from teto/owamp 2018-06-20 21:45:36 -04:00
rename.nix Merge pull request #42133 from markuskowa/pgbackup 2018-06-20 22:21:52 +01:00