From 0470545c87fc2f588f2c499894306163da948905 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 22 Jul 2024 13:14:32 +0200 Subject: [PATCH 1/3] wvstreams: init at 4.6.1 Pick patches from openembedded. --- pkgs/by-name/wv/wvstreams/package.nix | 110 ++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 pkgs/by-name/wv/wvstreams/package.nix diff --git a/pkgs/by-name/wv/wvstreams/package.nix b/pkgs/by-name/wv/wvstreams/package.nix new file mode 100644 index 000000000000..347b67313048 --- /dev/null +++ b/pkgs/by-name/wv/wvstreams/package.nix @@ -0,0 +1,110 @@ +{ + stdenv, + fetchpatch, + fetchurl, + dbus, + zlib, + openssl, + readline, + lib, + perl, +}: + +stdenv.mkDerivation { + pname = "wvstreams"; + version = "4.6.1"; + + # See https://layers.openembedded.org/layerindex/recipe/190863/ + src = fetchurl { + url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wvstreams/wvstreams-4.6.1.tar.gz"; + hash = "sha256-hAP1+/g6qawMbOFdl/2FYHSIFSqoTgB7fQYhuOvAdjM="; + }; + + patches = [ + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/04_signed_request.diff?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-zlPiME+KYjesmKt3a+JoE087qE1MbnlVPjC75qQoIks="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/05_gcc.diff?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-Twqk0J8E05kAvhHjAoAuYEpS445t3mb/BvuxTmaaGoM="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/06_gcc-4.7.diff?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-JMPNUdfAJ/gq+am/F1DE2q3+35ItiLAve1+LLl8+Oe4="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/07_buildflags.diff?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-N3HmuBakD5VHoToOqU6EmTHlgFG6A7x84Gbf2P2u+s8="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/gcc-6.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-fXhBUKaHD27mspwrKNY5G7F6UHqq/dmnPlf9cIvM7hM="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-55vWFfd/SDa9dE+GmSHDMU2kTrn+tNUW2clPknSdi7g="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-XRJCZMnygcQie9sUc1iCe9HVE9lEFCed4JRDtd/C/84="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-v0WAFyWwQ70dpq1BEXQjkOrdUUk4tBFJVKeHffs4FmA="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-1UZziDaE0BCM/YmYjBgFA2Q8zfnWpQcal08a0qcClmo="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-4Ad10pijea/qusrdCJAEjpc1/qfQNE32t/M2YMk5jNg="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-build-fix-parallel-make.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-zWREskvLoAH2sYn6kbemTC1V5KrF9jX0B0d+ASExQBA="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvrules.mk-Use-_DEFAULT_SOURCE.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-ACiuwqwg5nUbzqoJR5h9GENXmN3ELzkBjujZivBoM4g="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/openssl-buildfix.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-pMHopuBEge7Llq1Syb8sZJArhUOWBNmcOvVcNtFgnbA="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Forward-port-to-OpenSSL-1.1.x.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-R5pfYxefEvvxB1k+gZzRQgsbmkgpK9cBqZxCXHQnQlM="; + }) + (fetchpatch { + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Fix-narrowing-conversion-error.patch?id=0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37"; + hash = "sha256-esCD7jMVxD1sC2C4jx+pnnIWHpXAVGF/CGXvwHc9rhU="; + }) + ]; + + outputs = [ + "bin" + "dev" + "lib" + "out" + ]; + + enableParallelBuilding = true; + + buildInputs = [ + dbus + zlib + openssl + readline + perl + ]; + + meta = { + description = "Network programming library in C++"; + homepage = "http://alumnit.ca/wiki/index.php?page=WvStreams"; + license = lib.licenses.lgpl2; + maintainers = [ lib.maintainers.flokli ]; + platforms = lib.platforms.linux; + }; +} From 83b33609397553504eeabbebfacc6fb224cfd9a5 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 22 Jul 2024 13:36:25 +0200 Subject: [PATCH 2/3] wvdial: init at unstable-2016-06-15 --- pkgs/by-name/wv/wvdial/package.nix | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 pkgs/by-name/wv/wvdial/package.nix diff --git a/pkgs/by-name/wv/wvdial/package.nix b/pkgs/by-name/wv/wvdial/package.nix new file mode 100644 index 000000000000..c71addca1a9b --- /dev/null +++ b/pkgs/by-name/wv/wvdial/package.nix @@ -0,0 +1,44 @@ +{ + stdenv, + fetchFromGitea, + fetchpatch, + wvstreams, + pkg-config, + lib, +}: + +stdenv.mkDerivation { + pname = "wvdial"; + version = "unstable-2016-06-15"; + + src = fetchFromGitea { + domain = "gitea.osmocom.org"; + owner = "retronetworking"; + repo = "wvdial"; + rev = "42d084173cc939586c1963b8835cb00ec56b2823"; + hash = "sha256-q7pFvpJvv+ZvbN4xxolI9ZRULr+N5sqO9BOXUqSG5v4="; + }; + + patches = [ + (fetchpatch { + url = "https://git.openembedded.org/meta-openembedded/plain/meta-oe/recipes-connectivity/wvdial/wvdial/typo_pon.wvdial.1.patch?h=73a68490efe05cdbec540ec6f17782816632a24d"; + hash = "sha256-fsneoB5GeKH/nxwW0z8Mk6892PtnZ3J77wP4BGo3Tj8="; + }) + ]; + + buildInputs = [ wvstreams ]; + nativeBuildInputs = [ pkg-config ]; + + makeFlags = [ + "prefix=${placeholder "out"}" + "PPPDIR=${placeholder "out"}/etc/ppp/peers" + ]; + + meta = { + description = "A dialer that automatically recognises the modem"; + homepage = "https://gitea.osmocom.org/retronetworking/wvdial"; + license = lib.licenses.lgpl2; + maintainers = with lib.maintainers; [ flokli ]; + platforms = lib.platforms.linux; + }; +} From 21e3a4214f9917755ef220baf6982df749912d27 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 22 Jul 2024 13:50:27 +0200 Subject: [PATCH 3/3] nixos/wvdial: init module --- nixos/modules/module-list.nix | 1 + nixos/modules/services/networking/wvdial.nix | 47 ++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 nixos/modules/services/networking/wvdial.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index f97a6b47512c..d5e23170c267 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -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 diff --git a/nixos/modules/services/networking/wvdial.nix b/nixos/modules/services/networking/wvdial.nix new file mode 100644 index 000000000000..8e06d64940d0 --- /dev/null +++ b/nixos/modules/services/networking/wvdial.nix @@ -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 + /etc/wvdial.conf. + ''; + }; + 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; + }; +}