nixpkgs/pkgs/applications/networking/cluster/nixops/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

112 lines
3.1 KiB
Nix
Raw Normal View History

2021-10-17 22:38:58 +00:00
{ nixosTests
, pkgs
, poetry2nix
, lib
, overrides ? (self: super: {})
}:
let
interpreter = (
poetry2nix.mkPoetryPackages {
projectDir = ./.;
2022-10-07 05:49:13 +00:00
python = pkgs.python310;
overrides = [
poetry2nix.defaultPoetryOverrides
(import ./poetry-git-overlay.nix { inherit pkgs; })
(
self: super: {
nixops = super.nixops.overridePythonAttrs (
old: {
version = "${old.version}-pre-${lib.substring 0 7 super.nixops.src.rev or "dirty"}";
2021-09-20 12:58:18 +00:00
postPatch = ''
substituteInPlace nixops/args.py --subst-var version
'';
meta = old.meta // {
homepage = "https://github.com/NixOS/nixops";
description = "NixOS cloud provisioning and deployment tool";
maintainers = with lib.maintainers; [ adisbladis aminechikhaoui eelco rob domenkozar ];
platforms = lib.platforms.unix;
license = lib.licenses.lgpl3;
2023-05-26 13:55:57 +00:00
mainProgram = "nixops";
};
}
);
}
)
# User provided overrides
overrides
# Make nixops pluginable
2022-10-07 05:58:27 +00:00
(self: super: let
# Create a fake sphinx directory that doesn't pull the entire setup hook and incorrect python machinery
sphinx = pkgs.runCommand "sphinx" {} ''
mkdir -p $out/bin
for f in ${pkgs.python3.pkgs.sphinx}/bin/*; do
ln -s $f $out/bin/$(basename $f)
done
'';
in {
nixops = super.__toPluginAble {
drv = super.nixops;
finalDrv = self.nixops;
2022-10-07 05:58:27 +00:00
nativeBuildInputs = [ sphinx ];
postInstall = ''
doc_cache=$(mktemp -d)
sphinx-build -b man -d $doc_cache doc/ $out/share/man/man1
html=$(mktemp -d)
sphinx-build -b html -d $doc_cache doc/ $out/share/nixops/doc
'';
};
})
(self: super: {
cryptography = super.cryptography.overridePythonAttrs (old: {
meta = old.meta // {
knownVulnerabilities = old.meta.knownVulnerabilities or [ ]
++ lib.optionals (lib.versionOlder old.version "39.0.1") [
"CVE-2022-4304"
"CVE-2023-0215"
"CVE-2023-0216"
"CVE-2023-0217"
"CVE-2023-0401"
"CVE-2022-4203"
"CVE-2022-4450"
"CVE-2023-23931"
];
};
});
})
];
}
).python;
pkg = (interpreter.pkgs.nixops.withPlugins(ps: [
2021-10-17 22:38:58 +00:00
ps.nixops-aws
ps.nixops-digitalocean
2021-11-18 11:15:01 +00:00
ps.nixops-encrypted-links
2021-10-17 22:38:58 +00:00
ps.nixops-gcp
2021-11-18 11:15:01 +00:00
ps.nixops-hercules-ci
ps.nixops-hetzner
2021-10-17 22:38:58 +00:00
ps.nixopsvbox
2021-11-18 11:15:01 +00:00
ps.nixops-virtd
2022-12-18 23:19:29 +00:00
ps.nixops-hetznercloud
])).overrideAttrs (finalAttrs: prevAttrs: {
passthru = prevAttrs.passthru or {} // {
tests = prevAttrs.passthru.tests or {} //
nixosTests.nixops.unstable.passthru.override { nixopsPkg = pkg; };
};
});
2021-10-17 22:38:58 +00:00
in pkg