aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/tools/networking/openvpn/update-systemd-resolved.nix
blob: 1a192ce6688a5af972f583a17115205baab43dd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, stdenv, fetchFromGitHub
, makeWrapper
, iproute, systemd, coreutils, util-linux }:

stdenv.mkDerivation rec {
  pname = "update-systemd-resolved";
  version = "1.3.0";

  src = fetchFromGitHub {
    owner = "jonathanio";
    repo = "update-systemd-resolved";
    rev = "v${version}";
    sha256 = "19zhbpyms57yb70hi0ws5sbkpk2yqp9nnix3f86r36h1g93m70lm";
  };

  nativeBuildInputs = [ makeWrapper ];

  buildFlags = [
    "PREFIX=${placeholder "out"}/libexec/openvpn"
  ];

  installPhase = ''
    wrapProgram $out/libexec/openvpn/update-systemd-resolved \
      --prefix PATH : ${lib.makeBinPath [ iproute systemd coreutils util-linux ]}
  '';

  meta = with stdenv.lib; {
    description = "Helper script for OpenVPN to directly update the DNS settings of a link through systemd-resolved via DBus";
    homepage = "https://github.com/jonathanio/update-systemd-resolved";
    maintainers = with maintainers; [ eadwu ];
    license = licenses.gpl3;
    platforms = platforms.unix;
  };
}