Merge pull request #30563 from michaelpj/imp/tzupdate
tzupdate: init at 1.2.0 (+ service)
This commit is contained in:
commit
5f1d6bc5c7
@ -344,6 +344,7 @@
|
|||||||
./services/misc/svnserve.nix
|
./services/misc/svnserve.nix
|
||||||
./services/misc/synergy.nix
|
./services/misc/synergy.nix
|
||||||
./services/misc/taskserver
|
./services/misc/taskserver
|
||||||
|
./services/misc/tzupdate.nix
|
||||||
./services/misc/uhub.nix
|
./services/misc/uhub.nix
|
||||||
./services/misc/zookeeper.nix
|
./services/misc/zookeeper.nix
|
||||||
./services/monitoring/apcupsd.nix
|
./services/monitoring/apcupsd.nix
|
||||||
|
45
nixos/modules/services/misc/tzupdate.nix
Normal file
45
nixos/modules/services/misc/tzupdate.nix
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.tzupdate;
|
||||||
|
in {
|
||||||
|
options.services.tzupdate = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable the tzupdate timezone updating service. This provides
|
||||||
|
a one-shot service which can be activated with systemctl to
|
||||||
|
update the timezone.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# We need to have imperative time zone management for this to work.
|
||||||
|
# This will give users an error if they have set an explicit time
|
||||||
|
# zone, which is better than silently overriding it.
|
||||||
|
time.timeZone = null;
|
||||||
|
|
||||||
|
# We provide a one-shot service which can be manually run. We could
|
||||||
|
# provide a service that runs on startup, but it's tricky to get
|
||||||
|
# a service to run after you have *internet* access.
|
||||||
|
systemd.services.tzupdate = {
|
||||||
|
description = "tzupdate timezone update service";
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
# We could link directly into pkgs.tzdata, but at least timedatectl seems
|
||||||
|
# to expect the symlink to point directly to a file in etc.
|
||||||
|
# Setting the "debian timezone file" to point at /dev/null stops it doing anything.
|
||||||
|
ExecStart = "${pkgs.tzupdate}/bin/tzupdate -z /etc/zoneinfo -d /dev/null";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = [ maintainers.michaelpj ];
|
||||||
|
}
|
24
pkgs/applications/misc/tzupdate/default.nix
Normal file
24
pkgs/applications/misc/tzupdate/default.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ stdenv, python }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (python.pkgs) buildPythonApplication fetchPypi requests;
|
||||||
|
in
|
||||||
|
buildPythonApplication rec {
|
||||||
|
name = "${pname}-${version}";
|
||||||
|
pname = "tzupdate";
|
||||||
|
version = "1.2.0";
|
||||||
|
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
sha256 = "1wj2r1wirnn5kllaasdldimvp3cc3w7w890iqrjksz5wwjbnj8pk";
|
||||||
|
};
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ requests ];
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Update timezone information based on geoip.";
|
||||||
|
homepage = https://github.com/cdown/tzupdate;
|
||||||
|
maintainers = [ maintainers.michaelpj ];
|
||||||
|
license = licenses.unlicense;
|
||||||
|
};
|
||||||
|
}
|
@ -4622,6 +4622,8 @@ with pkgs;
|
|||||||
|
|
||||||
timetrap = callPackage ../applications/office/timetrap { };
|
timetrap = callPackage ../applications/office/timetrap { };
|
||||||
|
|
||||||
|
tzupdate = callPackage ../applications/misc/tzupdate { };
|
||||||
|
|
||||||
tinc = callPackage ../tools/networking/tinc { };
|
tinc = callPackage ../tools/networking/tinc { };
|
||||||
|
|
||||||
tie = callPackage ../development/tools/misc/tie { };
|
tie = callPackage ../development/tools/misc/tie { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user