All checks were successful
buildbot/nix-build .#checks.x86_64-linux.clan-dep-sops Build done.
buildbot/nix-build .#checks.aarch64-darwin.nixos-test_install_machine Build done.
buildbot/nix-build .#checks.aarch64-darwin.nixos-flash-installer Build done.
buildbot/nix-build .#checks.aarch64-darwin.nixos-iso-installer Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-test_install_machine Build done.
buildbot/nix-build .#checks.x86_64-linux.check-for-breakpoints Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-iso-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-ts-api Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-cli-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-fakeroot Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-git Build done.
buildbot/nix-build .#checks.x86_64-linux.renderClanOptions Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-tor Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-zbar Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-flash-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-webview-ui Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-age Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-e2fsprogs Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-nix Build done.
buildbot/nix-build .#checks.x86_64-linux."clan-dep-python3.11-qemu" Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-rsync Build done.
buildbot/nix-build .#checks.aarch64-darwin.nixos-test-backup Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-sshpass Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-test-backup Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-openssh Build done.
buildbot/nix-build .#checks.x86_64-linux.lib-jsonschema-example-valid Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-test-backup Build done.
buildbot/nix-build .#checks.x86_64-linux.borgbackup Build done.
buildbot/nix-build .#checks.x86_64-linux.package-default Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-clan-cli Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-default Build done.
buildbot/nix-build .#checks.x86_64-linux.package-zerotierone Build done.
buildbot/nix-build .#checks.x86_64-linux.package-zt-tcp-relay Build done.
buildbot/nix-build .#checks.x86_64-linux.package-module-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.secrets Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-flash-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.package-function-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-bash Build done.
buildbot/nix-build .#checks.x86_64-linux."clan-dep-python3.11-mypy" Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-vm-manager-no-breakpoints Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-cli Build done.
buildbot/nix-build .#checks.x86_64-linux.package-module-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.container Build done.
buildbot/nix-build .#checks.x86_64-linux.deltachat Build done.
buildbot/nix-build .#checks.x86_64-linux.matrix-synapse Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-test_install_machine Build done.
buildbot/nix-build .#checks.x86_64-linux.module-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.package-deploy-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.package-merge-after-ci Build done.
buildbot/nix-build .#checks.x86_64-linux.package-moonlight-sunshine-accept Build done.
buildbot/nix-build .#checks.x86_64-linux.treefmt Build done.
buildbot/nix-build .#checks.x86_64-linux.package-pending-reviews Build done.
buildbot/nix-build .#checks.x86_64-linux.package-tea-create-pr Build done.
buildbot/nix-build .#checks.x86_64-linux.package-wayland-proxy-virtwl Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-clan-vm-manager Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-vm-manager-pytest Build done.
buildbot/nix-build .#checks.x86_64-linux.package-zerotier-members Build done.
buildbot/nix-build .#checks.x86_64-linux.lib-jsonschema-nix-unit-tests Build done.
buildbot/nix-build .#checks.x86_64-linux.package-impure-checks Build done.
buildbot/nix-build .#checks.x86_64-linux.zt-tcp-relay Build done.
buildbot/nix-build .#checks.x86_64-linux.wayland-proxy-virtwl Build done.
buildbot/nix-build .#checks.x86_64-linux.package-iso-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.syncthing Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-pytest-without-core Build done.
buildbot/nix-build .#checks.x86_64-linux.test-backups Build done.
buildbot/nix-build .#checks.x86_64-linux.test-installation Build done.
buildbot/nix-eval Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-iso-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.package-webview-ui Build done.
buildbot/nix-build .#checks.x86_64-linux.package-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-vm-manager Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-pytest-with-core Build done.
checks / checks-impure (pull_request) Successful in 2m37s
Otherwise we become gentoo!
114 lines
2.9 KiB
Python
114 lines
2.9 KiB
Python
import json
|
|
import os
|
|
import tempfile
|
|
from pathlib import Path
|
|
from typing import Any
|
|
|
|
from .cmd import run
|
|
from .dirs import nixpkgs_flake, nixpkgs_source
|
|
|
|
|
|
def nix_command(flags: list[str]) -> list[str]:
|
|
return ["nix", "--extra-experimental-features", "nix-command flakes", *flags]
|
|
|
|
|
|
def nix_flake_show(flake_url: str | Path) -> list[str]:
|
|
return nix_command(
|
|
[
|
|
"flake",
|
|
"show",
|
|
"--json",
|
|
"--show-trace",
|
|
"--no-write-lock-file",
|
|
f"{flake_url}",
|
|
]
|
|
)
|
|
|
|
|
|
def nix_build(flags: list[str], gcroot: Path | None = None) -> list[str]:
|
|
if gcroot is not None:
|
|
return (
|
|
nix_command(
|
|
[
|
|
"build",
|
|
"--out-link",
|
|
str(gcroot),
|
|
"--print-out-paths",
|
|
"--no-write-lock-file",
|
|
]
|
|
)
|
|
+ flags
|
|
)
|
|
else:
|
|
return (
|
|
nix_command(
|
|
[
|
|
"build",
|
|
"--no-link",
|
|
"--print-out-paths",
|
|
"--no-write-lock-file",
|
|
]
|
|
)
|
|
+ flags
|
|
)
|
|
|
|
|
|
def nix_add_to_gcroots(nix_path: Path, dest: Path) -> None:
|
|
cmd = ["nix-store", "--realise", f"{nix_path}", "--add-root", f"{dest}"]
|
|
run(cmd)
|
|
|
|
|
|
def nix_config() -> dict[str, Any]:
|
|
cmd = nix_command(["show-config", "--json"])
|
|
proc = run(cmd)
|
|
data = json.loads(proc.stdout)
|
|
config = {}
|
|
for key, value in data.items():
|
|
config[key] = value["value"]
|
|
return config
|
|
|
|
|
|
def nix_eval(flags: list[str]) -> list[str]:
|
|
default_flags = nix_command(
|
|
[
|
|
"eval",
|
|
"--show-trace",
|
|
"--json",
|
|
"--no-write-lock-file",
|
|
]
|
|
)
|
|
if os.environ.get("IN_NIX_SANDBOX"):
|
|
with tempfile.TemporaryDirectory() as nix_store:
|
|
return [
|
|
*default_flags,
|
|
"--override-input",
|
|
"nixpkgs",
|
|
str(nixpkgs_source()),
|
|
# --store is required to prevent this error:
|
|
# error: cannot unlink '/nix/store/6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh': Operation not permitted
|
|
"--store",
|
|
nix_store,
|
|
*flags,
|
|
]
|
|
return default_flags + flags
|
|
|
|
|
|
def nix_metadata(flake_url: str | Path) -> dict[str, Any]:
|
|
cmd = nix_command(["flake", "metadata", "--json", f"{flake_url}"])
|
|
proc = run(cmd)
|
|
data = json.loads(proc.stdout)
|
|
return data
|
|
|
|
|
|
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
|
# we cannot use nix-shell inside the nix sandbox
|
|
# in our tests we just make sure we have all the packages
|
|
if os.environ.get("IN_NIX_SANDBOX"):
|
|
return cmd
|
|
return [
|
|
*nix_command(["shell", "--inputs-from", f"{nixpkgs_flake()!s}"]),
|
|
*packages,
|
|
"-c",
|
|
*cmd,
|
|
]
|