virtiofsd: fix nix chroot store support
This commit is contained in:
@@ -96,6 +96,7 @@
|
|||||||
./nixosModules/flake-module.nix
|
./nixosModules/flake-module.nix
|
||||||
./pkgs/flake-module.nix
|
./pkgs/flake-module.nix
|
||||||
./templates/flake-module.nix
|
./templates/flake-module.nix
|
||||||
|
./pkgs/clan-cli/clan_cli/tests/flake-module.nix
|
||||||
]
|
]
|
||||||
++ [
|
++ [
|
||||||
(if pathExists ./flakeModules/clan.nix then import ./flakeModules/clan.nix inputs.self else { })
|
(if pathExists ./flakeModules/clan.nix then import ./flakeModules/clan.nix inputs.self else { })
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import contextlib
|
import contextlib
|
||||||
|
import logging
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
@@ -6,7 +7,9 @@ from collections.abc import Iterator
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell, nix_test_store
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
@@ -14,6 +17,9 @@ def start_virtiofsd(socket_path: Path) -> Iterator[None]:
|
|||||||
sandbox = "namespace"
|
sandbox = "namespace"
|
||||||
if shutil.which("newuidmap") is None:
|
if shutil.which("newuidmap") is None:
|
||||||
sandbox = "none"
|
sandbox = "none"
|
||||||
|
store_root = nix_test_store() or Path("/")
|
||||||
|
store = store_root / "nix" / "store"
|
||||||
|
|
||||||
virtiofsd = nix_shell(
|
virtiofsd = nix_shell(
|
||||||
["virtiofsd"],
|
["virtiofsd"],
|
||||||
[
|
[
|
||||||
@@ -25,9 +31,10 @@ def start_virtiofsd(socket_path: Path) -> Iterator[None]:
|
|||||||
"--sandbox",
|
"--sandbox",
|
||||||
sandbox,
|
sandbox,
|
||||||
"--shared-dir",
|
"--shared-dir",
|
||||||
"/nix/store",
|
str(store),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
log.debug("$ {}".format(" ".join(virtiofsd)))
|
||||||
with subprocess.Popen(virtiofsd) as proc:
|
with subprocess.Popen(virtiofsd) as proc:
|
||||||
try:
|
try:
|
||||||
while not socket_path.exists():
|
while not socket_path.exists():
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"clanServices"
|
"clanServices"
|
||||||
"pkgs/zerotierone"
|
"pkgs/zerotierone"
|
||||||
"pkgs/minifakeroot"
|
"pkgs/minifakeroot"
|
||||||
|
"pkgs/clan-cli/clan_cli/tests/flake-module.nix"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user