summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/nixops/unwrapped.nix
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-10-25 12:23:27 +0300
committerK900 <me@0upti.me>2023-10-26 19:05:41 +0300
commit3f2deb9e98a742747ab641a36fab2e942acc33b8 (patch)
tree10ed882e3f115f19f1850930a3d0c6637de1daab /pkgs/applications/networking/cluster/nixops/unwrapped.nix
parent637718ac2a8126e47d86fd5ef3b8711dd5233a88 (diff)
downloadnixpkgs-3f2deb9e98a742747ab641a36fab2e942acc33b8.tar
nixpkgs-3f2deb9e98a742747ab641a36fab2e942acc33b8.tar.gz
nixpkgs-3f2deb9e98a742747ab641a36fab2e942acc33b8.tar.bz2
nixpkgs-3f2deb9e98a742747ab641a36fab2e942acc33b8.tar.lz
nixpkgs-3f2deb9e98a742747ab641a36fab2e942acc33b8.tar.xz
nixpkgs-3f2deb9e98a742747ab641a36fab2e942acc33b8.tar.zst
nixpkgs-3f2deb9e98a742747ab641a36fab2e942acc33b8.zip
nixops (unstable): switch to non-poetry2nix packaging
Mostly nix-init with some manual fixups. withPlugins implementation copied from Poetry.
Diffstat (limited to 'pkgs/applications/networking/cluster/nixops/unwrapped.nix')
-rw-r--r--pkgs/applications/networking/cluster/nixops/unwrapped.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/nixops/unwrapped.nix b/pkgs/applications/networking/cluster/nixops/unwrapped.nix
new file mode 100644
index 00000000000..c70da930469
--- /dev/null
+++ b/pkgs/applications/networking/cluster/nixops/unwrapped.nix
@@ -0,0 +1,65 @@
+{ lib
+, buildPythonApplication
+, fetchFromGitHub
+, unstableGitUpdater
+, poetry-core
+, sphinx
+, pluggy
+, prettytable
+, typeguard
+, typing-extensions
+, nixosTests
+}:
+
+buildPythonApplication rec {
+  pname = "nixops";
+  version = "unstable-2023-10-26";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "NixOS";
+    repo = "nixops";
+    rev = "2cfc2cb4fa9ecb89a4274574ff7f63ea61782498";
+    hash = "sha256-4uvQQkERZFEeRJjMAcyLYJzNvH0rNiiJ+5BDQmD58gI=";
+  };
+
+  postPatch = ''
+    substituteInPlace nixops/args.py --replace "@version@" "${version}-pre-${lib.substring 0 7 src.rev or "dirty"}"
+  '';
+
+  nativeBuildInputs = [
+    poetry-core
+    sphinx
+  ];
+
+  propagatedBuildInputs = [
+    pluggy
+    prettytable
+    typeguard
+    typing-extensions
+  ];
+
+  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
+  '';
+
+  pythonImportsCheck = [ "nixops" ];
+
+  passthru = {
+    tests.nixops = nixosTests.nixops.unstable;
+    updateScript = unstableGitUpdater {};
+  };
+
+  meta = with lib; {
+    description = "A tool for deploying to NixOS machines in a network or cloud";
+    homepage = "https://github.com/NixOS/nixops";
+    license = licenses.lgpl3Only;
+    maintainers = with lib.maintainers; [ adisbladis aminechikhaoui roberth ];
+    platforms = lib.platforms.unix;
+    mainProgram = "nixops";
+  };
+}