infrastructure/nix/packages/ionos-dyndns.nix

38 lines
854 B
Nix

{
fetchFromGitHub,
lib,
makeWrapper,
stdenv,
# Runtime Dependencies
python3,
# grep
gnugrep,
# ip
iproute2,
# hostname
hostname
}:
let
pythonWithDeps = python3.withPackages (p: [p.requests]);
in stdenv.mkDerivation rec {
pname = "ionos-dyndns";
# Packaging time, not commit time
version = "20231118";
src = fetchFromGitHub {
owner = "lazaroblanc";
repo = "IONOS-DynDNS";
rev = "6c090ab928ce8d6eaa28b09614995b036ad60027";
hash = "sha256-rabDuKuPvzcMltnCSvc5kDjcDhv7sXxbDLWw3/hdSmk=";
};
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
install -Dm755 $src/ionos_dyndns.py $out/lib/ionos_dyndns.py
makeWrapper ${pythonWithDeps}/bin/python3 $out/bin/ionos-dyndns \
--set PATH ${lib.makeBinPath [ iproute2 gnugrep hostname ]} \
--add-flags $out/lib/ionos_dyndns.py
'';
}