mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-11-06 02:06:46 +01:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{ stdenv, lib, fetchFromGitHub, makeWrapper, openresolv, coreutils, systemd }:
|
|
|
|
let
|
|
binPath = lib.makeBinPath [ coreutils openresolv systemd ];
|
|
|
|
in stdenv.mkDerivation {
|
|
name = "update-resolv-conf-2017-06-21";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "masterkorp";
|
|
repo = "openvpn-update-resolv-conf";
|
|
rev = "43093c2f970bf84cd374e18ec05ac6d9cae444b8";
|
|
sha256 = "1lf66bsgv2w6nzg1iqf25zpjf4ckcr45adkpgdq9gvhkfnvlp8av";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
installPhase = ''
|
|
install -Dm555 update-resolv-conf.sh $out/libexec/openvpn/update-resolv-conf
|
|
install -Dm555 update-systemd-network.sh $out/libexec/openvpn/update-systemd-network
|
|
|
|
for i in $out/libexec/openvpn/*; do
|
|
wrapProgram $i --prefix PATH : ${binPath}
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options";
|
|
homepage = "https://github.com/masterkorp/openvpn-update-resolv-conf/";
|
|
maintainers = with maintainers; [ abbradar ];
|
|
license = licenses.gpl2;
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|