2020-08-18 09:33:47 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonApplication
|
|
|
|
, jinja2
|
|
|
|
, oauthlib
|
|
|
|
, configobj
|
|
|
|
, pyyaml
|
|
|
|
, requests
|
|
|
|
, jsonschema
|
|
|
|
, jsonpatch
|
|
|
|
, pytest
|
|
|
|
, httpretty
|
|
|
|
, dmidecode
|
|
|
|
, pytestCheckHook
|
|
|
|
, shadow
|
|
|
|
, cloud-utils
|
|
|
|
, openssh
|
|
|
|
}:
|
2014-10-17 15:09:20 +01:00
|
|
|
|
2020-10-15 00:09:00 +01:00
|
|
|
let version = "20.3";
|
2014-10-17 15:09:20 +01:00
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
in buildPythonApplication {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "cloud-init";
|
|
|
|
inherit version;
|
2014-10-17 15:09:20 +01:00
|
|
|
namePrefix = "";
|
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "canonical";
|
|
|
|
repo = "cloud-init";
|
|
|
|
rev = version;
|
2020-10-15 00:09:00 +01:00
|
|
|
sha256 = "1fmckxf4q4sxjqs758vw7ca0rnhl9hyq67cqpqzz2v3s1gqzjhm4";
|
2014-10-17 15:09:20 +01:00
|
|
|
};
|
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
patches = [ ./0001-add-nixos-support.patch ];
|
2017-04-21 09:55:14 +01:00
|
|
|
prePatch = ''
|
2020-08-18 09:33:47 +01:00
|
|
|
substituteInPlace setup.py --replace /lib/systemd $out/lib/systemd
|
|
|
|
'';
|
2015-01-08 09:26:49 +00:00
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
postInstall = ''
|
|
|
|
install -D -m755 ./tools/write-ssh-key-fingerprints $out/libexec/write-ssh-key-fingerprints
|
|
|
|
for i in $out/libexec/*; do
|
|
|
|
wrapProgram $i --prefix PATH : "${lib.makeBinPath [ openssh ]}"
|
|
|
|
done
|
|
|
|
'';
|
2017-04-21 11:48:02 +01:00
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jinja2
|
|
|
|
oauthlib
|
|
|
|
configobj
|
|
|
|
pyyaml
|
|
|
|
requests
|
|
|
|
jsonschema
|
|
|
|
jsonpatch
|
|
|
|
];
|
2017-06-05 20:41:31 +01:00
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
httpretty
|
|
|
|
dmidecode
|
|
|
|
# needed for tests; at runtime we rather want the setuid wrapper
|
|
|
|
shadow
|
|
|
|
];
|
2014-10-17 15:09:20 +01:00
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [
|
|
|
|
dmidecode cloud-utils.guest
|
|
|
|
]}/bin"
|
|
|
|
];
|
2014-10-17 15:09:20 +01:00
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
disabledTests = [
|
|
|
|
# tries to create /var
|
|
|
|
"test_dhclient_run_with_tmpdir"
|
|
|
|
# clears path and fails because mkdir is not found
|
|
|
|
"test_path_env_gets_set_from_main"
|
2020-10-15 00:09:00 +01:00
|
|
|
# tries to read from /etc/ca-certificates.conf while inside the sandbox
|
|
|
|
"test_handler_ca_certs"
|
2020-08-18 09:33:47 +01:00
|
|
|
];
|
2017-12-11 11:04:06 +00:00
|
|
|
|
2020-08-18 09:33:47 +01:00
|
|
|
preCheck = ''
|
|
|
|
# TestTempUtils.test_mkdtemp_default_non_root does not like TMPDIR=/build
|
|
|
|
export TMPDIR=/tmp
|
|
|
|
'';
|
2017-12-11 11:04:06 +00:00
|
|
|
|
2014-10-17 15:09:20 +01:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://cloudinit.readthedocs.org";
|
2016-06-20 11:53:46 +01:00
|
|
|
description = "Provides configuration and customization of cloud instance";
|
2017-02-20 16:24:45 +00:00
|
|
|
maintainers = [ lib.maintainers.madjar lib.maintainers.phile314 ];
|
2014-10-17 15:09:20 +01:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|