mozillavpn: init at 2.7.1

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2022-02-14 14:53:18 -08:00
parent 18bd82edcc
commit abfcc2e0ff
6 changed files with 144 additions and 0 deletions

View file

@ -161,6 +161,15 @@
to be able to access the device.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/mozilla-mobile/mozilla-vpn-client">mozillavpn</link>,
the client for the
<link xlink:href="https://vpn.mozilla.org/">Mozilla VPN</link>
service. Available as
<link xlink:href="options.html#opt-services.mozillavpn">services.mozillavpn</link>.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/mgumz/mtr-exporter">mtr-exporter</link>,

View file

@ -49,6 +49,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- [K40-Whisperer](https://www.scorchworks.com/K40whisperer/k40whisperer.html), a program to control cheap Chinese laser cutters. Available as [programs.k40-whisperer.enable](options.html#opt-programs.k4-whisperer.enable). Users must add themselves to the `k40` group to be able to access the device.
- [mozillavpn](https://github.com/mozilla-mobile/mozilla-vpn-client), the client for the [Mozilla VPN](https://vpn.mozilla.org/) service. Available as [services.mozillavpn](options.html#opt-services.mozillavpn).
- [mtr-exporter](https://github.com/mgumz/mtr-exporter), a Prometheus exporter for mtr metrics. Available as [services.mtr-exporter](options.html#opt-services.mtr-exporter.enable).
- [tetrd](https://tetrd.app), share your internet connection from your device to your PC and vice versa through a USB cable. Available at [services.tetrd](#opt-services.tetrd.enable).

View file

@ -805,6 +805,7 @@
./services/networking/mosquitto.nix
./services/networking/monero.nix
./services/networking/morty.nix
./services/networking/mozillavpn.nix
./services/networking/miredo.nix
./services/networking/mstpd.nix
./services/networking/mtprotoproxy.nix

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
{
options.services.mozillavpn.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enable the Mozilla VPN daemon.
'';
};
config = lib.mkIf config.services.mozillavpn.enable {
environment.systemPackages = [ pkgs.mozillavpn ];
services.dbus.packages = [ pkgs.mozillavpn ];
systemd.packages = [ pkgs.mozillavpn ];
};
meta.maintainers = with lib.maintainers; [ andersk ];
}

View file

@ -0,0 +1,111 @@
{ buildGoModule
, fetchFromGitHub
, go
, lib
, pkg-config
, polkit
, python3
, qmake
, qtbase
, qtcharts
, qtgraphicaleffects
, qtnetworkauth
, qtquickcontrols2
, qttools
, qtwebsockets
, stdenv
, which
, wireguard-tools
, wrapQtAppsHook
}:
let
glean_parser_4_1_1 = python3.pkgs.buildPythonPackage rec {
pname = "glean_parser";
version = "4.1.1";
src = python3.pkgs.fetchPypi {
inherit pname version;
hash = "sha256-4noazRqjjJNI2kTO714kSp70jZpWmqHWR2vnkgAftLE=";
};
nativeBuildInputs = with python3.pkgs; [ setuptools-scm ];
propagatedBuildInputs = with python3.pkgs; [
appdirs
click
diskcache
jinja2
jsonschema
pyyaml
setuptools
yamllint
];
postPatch = ''
substituteInPlace setup.py --replace '"pytest-runner", ' ""
'';
doCheck = false;
};
pname = "mozillavpn";
version = "2.7.1";
src = fetchFromGitHub {
owner = "mozilla-mobile";
repo = "mozilla-vpn-client";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-i551UkCOwWnioe1YgCNZAlYiQJ4YDDBMoDZhfbkLTbs=";
};
netfilter-go-modules = (buildGoModule {
inherit pname version src;
vendorSha256 = "sha256-KFYMim5U8WlJHValvIBQgEN+17SDv0JVbH03IiyfDc0=";
modRoot = "linux/netfilter";
}).go-modules;
in
stdenv.mkDerivation {
inherit pname version src;
buildInputs = [
polkit
qtbase
qtcharts
qtgraphicaleffects
qtnetworkauth
qtquickcontrols2
qtwebsockets
];
nativeBuildInputs = [
glean_parser_4_1_1
go
pkg-config
python3
python3.pkgs.pyyaml
qmake
qttools
which
wrapQtAppsHook
];
postPatch = ''
for file in linux/*.service linux/extra/*.desktop src/platforms/linux/daemon/*.service; do
substituteInPlace "$file" --replace /usr/bin/mozillavpn "$out/bin/mozillavpn"
done
'';
preBuild = ''
ln -s '${netfilter-go-modules}' linux/netfilter/vendor
python3 scripts/generate_glean.py
python3 scripts/importLanguages.py
'';
qmakeFlags = [ "USRPATH=$(out)" "ETCPATH=$(out)/etc" ];
qtWrapperArgs =
[ "--prefix" "PATH" ":" (lib.makeBinPath [ wireguard-tools ]) ];
meta = {
description = "Client for the Mozilla VPN service";
homepage = "https://vpn.mozilla.org/";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [ andersk ];
platforms = lib.platforms.linux;
};
}

View file

@ -4985,6 +4985,8 @@ with pkgs;
mcrcon = callPackage ../tools/networking/mcrcon {};
mozillavpn = libsForQt5.callPackage ../tools/networking/mozillavpn { };
mozwire = callPackage ../tools/networking/mozwire {
inherit (darwin.apple_sdk.frameworks) Security;
};