nixbld: fix nixops deprecated pipes module

This commit was merged in pull request #89.
This commit is contained in:
2025-12-16 12:26:02 +08:00
committed by sb10q
parent 56ed3f1e1a
commit 853b80999d
2 changed files with 26 additions and 1 deletions

View File

@@ -933,7 +933,10 @@ in
nixpkgs.config.packageOverrides = super: let self = super.pkgs; in {
nix = super.nix.appendPatches [ ./nix-networked-derivations.patch ];
nixops_unstable_minimal = super.nixops_unstable_minimal.overrideAttrs (oa: {
patches = oa.patches or [] ++ [ ./nixops-skip-unreachable-host.patch ];
patches = oa.patches or [] ++ [
./nixops-skip-unreachable-host.patch
./nixops-fix-deprecated-pipes.patch
];
});
hydra = super.hydra.overrideAttrs(oa: {
patches = oa.patches or [] ++ [

View File

@@ -0,0 +1,22 @@
diff --git a/nixops/script_defs.py b/nixops/script_defs.py
index 2f75e943..7268ca3a 100644
--- a/nixops/script_defs.py
+++ b/nixops/script_defs.py
@@ -22,7 +22,7 @@ import logging
import logging.handlers
import json
from tempfile import TemporaryDirectory
-import pipes
+import shlex
from typing import Tuple, List, Optional, Union, Generator, Type, Set, Sequence
import nixops.ansi
@@ -1117,7 +1117,7 @@ def op_edit(args: Namespace) -> None:
if not editor:
raise Exception("the $EDITOR environment variable is not set")
os.system(
- "$EDITOR " + " ".join([pipes.quote(x) for x in depl.network_expr.network])
+ "$EDITOR " + " ".join([shlex.quote(x) for x in depl.network_expr.network])
)