3a4df29a92
GitOrigin-RevId: 3d7435c638baffaa826b85459df0fff47f12317d
37 lines
941 B
Nix
37 lines
941 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.localtimed;
|
|
in {
|
|
imports = [ (lib.mkRenamedOptionModule [ "services" "localtime" ] [ "services" "localtimed" ]) ];
|
|
|
|
options = {
|
|
services.localtimed = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Enable <literal>localtimed</literal>, a simple daemon for keeping the
|
|
system timezone up-to-date based on the current location. It uses
|
|
geoclue2 to determine the current location.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.geoclue2.appConfig.localtimed = {
|
|
isAllowed = true;
|
|
isSystem = true;
|
|
};
|
|
|
|
# Install the polkit rules.
|
|
environment.systemPackages = [ pkgs.localtime ];
|
|
# Install the systemd unit.
|
|
systemd.packages = [ pkgs.localtime ];
|
|
|
|
systemd.services.localtime.wantedBy = [ "multi-user.target" ];
|
|
};
|
|
}
|