mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
nixos/wvdial: init module
This commit is contained in:
parent
83b3360939
commit
21e3a4214f
@ -1242,6 +1242,7 @@
|
||||
./services/networking/websockify.nix
|
||||
./services/networking/wg-access-server.nix
|
||||
./services/networking/wg-netmanager.nix
|
||||
./services/networking/wvdial.nix
|
||||
./services/networking/webhook.nix
|
||||
./services/networking/wg-quick.nix
|
||||
./services/networking/wgautomesh.nix
|
||||
|
47
nixos/modules/services/networking/wvdial.nix
Normal file
47
nixos/modules/services/networking/wvdial.nix
Normal file
@ -0,0 +1,47 @@
|
||||
# Global configuration for wvdial.
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.environment.wvdial;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
environment.wvdial = {
|
||||
dialerDefaults = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
example = ''Init1 = AT+CGDCONT=1,"IP","internet.t-mobile"'';
|
||||
description = ''
|
||||
Contents of the "Dialer Defaults" section of
|
||||
<filename>/etc/wvdial.conf</filename>.
|
||||
'';
|
||||
};
|
||||
pppDefaults = lib.mkOption {
|
||||
default = ''
|
||||
noipdefault
|
||||
usepeerdns
|
||||
defaultroute
|
||||
persist
|
||||
noauth
|
||||
'';
|
||||
type = lib.types.str;
|
||||
description = "Default ppp settings for wvdial.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.dialerDefaults != "") {
|
||||
environment.etc."wvdial.conf".source = pkgs.writeText "wvdial.conf" ''
|
||||
[Dialer Defaults]
|
||||
PPPD PATH = ${pkgs.ppp}/sbin/pppd
|
||||
${config.environment.wvdial.dialerDefaults}
|
||||
'';
|
||||
environment.etc."ppp/peers/wvdial".source = pkgs.writeText "wvdial" cfg.pppDefaults;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user