mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
commit
7529fd3bff
@ -354,6 +354,7 @@
|
||||
./services/networking/haproxy.nix
|
||||
./services/networking/heyefi.nix
|
||||
./services/networking/hostapd.nix
|
||||
./services/networking/htpdate.nix
|
||||
./services/networking/i2pd.nix
|
||||
./services/networking/i2p.nix
|
||||
./services/networking/iodine.nix
|
||||
|
80
nixos/modules/services/networking/htpdate.nix
Normal file
80
nixos/modules/services/networking/htpdate.nix
Normal file
@ -0,0 +1,80 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (pkgs) htpdate;
|
||||
|
||||
cfg = config.services.htpdate;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.htpdate = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable htpdate daemon.
|
||||
'';
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
Additional command line arguments to pass to htpdate.
|
||||
'';
|
||||
};
|
||||
|
||||
servers = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "www.google.com" ];
|
||||
description = ''
|
||||
HTTP servers to use for time synchronization.
|
||||
'';
|
||||
};
|
||||
|
||||
proxy = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "127.0.0.1:8118";
|
||||
description = ''
|
||||
HTTP proxy used for requests.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
systemd.services.htpdate = {
|
||||
description = "htpdate daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
PIDFile = "/var/run/htpdate.pid";
|
||||
ExecStart = concatStringsSep " " [
|
||||
"${htpdate}/bin/htpdate"
|
||||
"-D -u nobody"
|
||||
"-a -s"
|
||||
"-l"
|
||||
"${optionalString (cfg.proxy != "") "-P ${cfg.proxy}"}"
|
||||
"${cfg.extraOptions}"
|
||||
"${concatStringsSep " " cfg.servers}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
24
pkgs/tools/networking/htpdate/default.nix
Normal file
24
pkgs/tools/networking/htpdate/default.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{ stdenv, fetchurl, coreutils, binutils }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.1.3";
|
||||
name = "htpdate-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://twekkel.home.xs4all.nl/htp/htpdate-${version}.tar.gz";
|
||||
sha256 = "0hfg4qrsmpqw03m9qwf3zgi4brbf65w6wd3w30nkamc7x8b4vn5i";
|
||||
};
|
||||
|
||||
installFlags = [
|
||||
"INSTALL=${coreutils}/bin/install"
|
||||
"STRIP=${binutils}/bin/strip"
|
||||
"prefix=$(out)"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Utility to fetch time and set the system clock over HTTP";
|
||||
homepage = http://www.vervest.org/htp/;
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
};
|
||||
}
|
@ -2066,6 +2066,8 @@ in
|
||||
|
||||
hping = callPackage ../tools/networking/hping { };
|
||||
|
||||
htpdate = callPackage ../tools/networking/htpdate { };
|
||||
|
||||
http-prompt = callPackage ../tools/networking/http-prompt { };
|
||||
|
||||
httpie = callPackage ../tools/networking/httpie { };
|
||||
|
Loading…
Reference in New Issue
Block a user