From aaab2dcf581ef11b9b284b41bac594499c6dfbe8 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Sat, 26 Jun 2021 18:37:37 +0300 Subject: [PATCH] feat(openvpn-update-resolv-conf): add --- README.org | 27 ++++++++++++----------- openvpn-update-resolv.scm | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 openvpn-update-resolv.scm diff --git a/README.org b/README.org index 1fb1537..ddce81f 100644 --- a/README.org +++ b/README.org @@ -5,16 +5,17 @@ My Guix channel. I'll probably push what I can upstream when I figure Guix out. * Status -| Software | Status | Problems | -|-----------------+----------+----------------------------------------------| -| [[https://gitlab.com/dwt1/shell-color-scripts][dt-colorscripts]] | OK | Check for implicit dependencies | -| [[https://yadm.io/][yadm]] | OK | Check for implicit dependencies; description | -| [[https://github.com/SqrtMinusOne/mpd-watcher][mpd-watcher]] | OK | | -| [[https://github.com/risacher/sunwait][sunwait]] | OK | Version number | -| [[https://github.com/deajan/osync][osync]] | Works | Requires shell commands as propagated-inputs | -| [[https://github.com/latex-lsp/texlab/][texlab]] | Works | Installation from binaries | -| [[https://github.com/tmux-python/tmuxp][tmuxp]] | Works | Tests fail | -| [[https://github.com/hroptatyr/dateutils][dateutils]] | Works | Tests fail | -| [[https://starship.rs/][starship]] | Works | Tests fail | -| [[https://github.com/gauteh/lieer][lieer]] | Works | Tests fail for dependencies | -| [[https://activitywatch.net/][ActivityWatch]] | Works... | Except for aw-qt. Installation from binaries | +| Software | Status | Problems | +|----------------------------+----------+---------------------------------------------------| +| [[https://gitlab.com/dwt1/shell-color-scripts][dt-colorscripts]] | OK | Check for implicit dependencies | +| [[https://yadm.io/][yadm]] | OK | Check for implicit dependencies; description | +| [[https://github.com/SqrtMinusOne/mpd-watcher][mpd-watcher]] | OK | | +| [[https://github.com/risacher/sunwait][sunwait]] | OK | Version number | +| [[https://github.com/alfredopalhares/openvpn-update-resolv-conf][openvpn-update-resolv-conf]] | OK | Just watch out for $PATH if launched from OpenVPN | +| [[https://github.com/deajan/osync][osync]] | Works | Requires shell commands as propagated-inputs | +| [[https://github.com/latex-lsp/texlab/][texlab]] | Works | Installation from binaries | +| [[https://github.com/tmux-python/tmuxp][tmuxp]] | Works | Tests fail | +| [[https://github.com/hroptatyr/dateutils][dateutils]] | Works | Tests fail | +| [[https://starship.rs/][starship]] | Works | Tests fail | +| [[https://github.com/gauteh/lieer][lieer]] | Works | Tests fail for dependencies | +| [[https://activitywatch.net/][ActivityWatch]] | Works... | Except for aw-qt. Installation from binaries | diff --git a/openvpn-update-resolv.scm b/openvpn-update-resolv.scm new file mode 100644 index 0000000..3f37260 --- /dev/null +++ b/openvpn-update-resolv.scm @@ -0,0 +1,45 @@ +(define-module (openvpn-update-resolv) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix build-system gnu) + #:use-module (guix git-download) + #:use-module (gnu packages base) + #:use-module (gnu packages dns)) + +(define-public openvpn-update-resolve-conf + (package + (name "openvpn-update-resolve-conf") + (version "20200326") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/alfredopalhares/openvpn-update-resolv-conf") + (commit "028849116a0691352a5458c7b0f8bdfd9980b443"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1x2idhn532n0y3879a6cmk9l44bg0njxkxv68zscwdncw84mfbbs")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'bootstrap) + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) + (substitute* "update-resolv-conf.sh" + (("RESOLVCONF=.*") + (format #f "RESOLVCONF=~s\n" (which "resolvconf")))) + (substitute* "update-resolv-conf.sh" + (("cut") (which "cut"))) + (install-file "update-resolv-conf.sh" bin))))))) + (inputs + `(("openresolv" ,openresolv) + ("coreutils" ,coreutils))) + (synopsis "Script that updates DNS settings are pushed by the OpenVPN server") + (home-page "https://github.com/alfredopalhares/openvpn-update-resolv-conf") + (license license:gpl2) + (description "This is a script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options. Since network management is out of OpenVPN client scope, this script adds and removes the provided from those settings.")))