nixos/automatic-timezoned: Fix boot delays and systemd unit ordering
Since the service sets WantedBy=default.target, graphical.target ends up waiting for it to complete. Since geoclue.service, which this service depends on, in turn depends on network-online.target, this ends up making full boot wait for network availability.
This is obviously unintended; The unit should have always had an After=default.target.
Furthermore, the systemd docs recommend depending on specifically multi-user.target or graphical.target, rather than default.target. In practice, on a default NixOS system, using default.target delays starting this service until a graphical session starts - this is obviously not ideal, since it makes sense to update the timezone on a non-graphical system as well, so we fix that while we're at it.
Things done
- Built on platform:
- [x] x86_64-linux
- [ ] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- Tested, as applicable:
- [ ] NixOS tests in nixos/tests.
- [ ] Package tests at
passthru.tests. - [ ] Tests in lib/tests or pkgs/test for functions and "core" functionality.
- [x] Ran
nixpkgs-reviewon this PR. See nixpkgs-review usage. - [ ] Tested basic functionality of all binary files, usually in
./result/bin/. - Nixpkgs Release Notes
- [ ] Package update: when the change is major or breaking.
- NixOS Release Notes
- [ ] Module addition: when adding a new NixOS module.
- [ ] Module update: when the change is significant.
- [x] Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.
Add a :+1: reaction to pull requests you find important.
@maxbrunet maintains the package, maybe you want to take a look?
To save others the time (though I think it's quite obvious that the commit doesn't touch any packages):
nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review pr 470359
Commit: 718167630e3d15ac76f80b4f07f0a8febb2fb6eb
x86_64-linux
:fast_forward: 2 packages blacklisted:
- nixos-install-tools
- tests.nixos-functions.nixos-test
:white_check_mark: 1 package built:
- nixpkgs-manual
Thanks for the swift review :) As for upstreaming this, I think I've figured out enough contribution practices for repos for one weekend ;)