3 Commits

Author SHA1 Message Date
be2a207bf1 Merge branch 'main' into feature/logging-and-exit
Some checks failed
Check Nix flake / Build nix outputs (ubuntu-latest) (pull_request) Failing after 55s
Check flake.lock / Check health of `flake.lock` (pull_request) Failing after 9s
Check Nix formatting / Perform Nix format checks (pull_request) Has been cancelled
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Successful in 6m27s
2025-05-26 19:56:44 -04:00
742124d8e6 add determinate nix installer mirror
Some checks failed
Check Nix formatting / Perform Nix format checks (pull_request) Has been cancelled
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Has been cancelled
Check Nix flake / Build nix outputs (ubuntu-latest) (pull_request) Has been cancelled
Check flake.lock / Check health of `flake.lock` (pull_request) Failing after 10s
2025-05-26 19:56:19 -04:00
2e8930cf1d allow IFD in nix flake show
Some checks failed
Check Nix flake / Build nix outputs (ubuntu-latest) (pull_request) Has been cancelled
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Has been cancelled
Check Nix formatting / Perform Nix format checks (pull_request) Has been cancelled
Check flake.lock / Check health of `flake.lock` (pull_request) Failing after 13s
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
2025-05-26 19:53:24 -04:00
6 changed files with 35 additions and 5 deletions

View File

@@ -13,7 +13,15 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: DeterminateSystems/nix-installer-action@main
- name: Get Latest Determinate Nix Installer binary
id: latest-installer
uses: sigyl-actions/gitea-action-get-latest-release@main
with:
repository: ahuston-0/determinate-nix-mirror
- name: Install nix
uses: https://github.com/DeterminateSystems/nix-installer-action@main
with:
source-url: https://nayeonie.com/ahuston-0/determinate-nix-mirror/releases/download/${{ steps.latest-installer.outputs.release }}/nix-installer-x86_64-linux
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
with:

View File

@@ -11,8 +11,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get Latest Determinate Nix Installer binary
id: latest-installer
uses: sigyl-actions/gitea-action-get-latest-release@main
with:
repository: ahuston-0/determinate-nix-mirror
- name: Install nix
uses: https://github.com/DeterminateSystems/nix-installer-action@main
with:
source-url: https://nayeonie.com/ahuston-0/determinate-nix-mirror/releases/download/${{ steps.latest-installer.outputs.release }}/nix-installer-x86_64-linux
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
with:

View File

@@ -10,7 +10,15 @@ jobs:
name: "Perform Nix format checks"
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@main
- name: Get Latest Determinate Nix Installer binary
id: latest-installer
uses: sigyl-actions/gitea-action-get-latest-release@main
with:
repository: ahuston-0/determinate-nix-mirror
- name: Install nix
uses: https://github.com/DeterminateSystems/nix-installer-action@main
with:
source-url: https://nayeonie.com/ahuston-0/determinate-nix-mirror/releases/download/${{ steps.latest-installer.outputs.release }}/nix-installer-x86_64-linux
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
with:

View File

@@ -21,6 +21,11 @@ def parse_inputs() -> argparse.Namespace:
action="store_true",
help="whether to compare two drv sets, must provide two evaluation jsons to compare",
)
parser.add_argument(
"--allow-import-from-derivation",
action="store_true",
help="whether to allow IFD during certain actions (ex. nix flake show)",
)
parser.add_argument(
"--compare-pre-json",
metavar="pre-json-path",

View File

@@ -71,7 +71,7 @@ def get_derivations_from_check(nix_path: str, path_to_flake: str) -> list[str]:
return derivations
def get_derivations(path_to_flake: str) -> list[str]:
def get_derivations(path_to_flake: str, *, allow_import_from_derivation: False = False) -> list[str]:
"""Gets all derivations present in a flake.
:param path_to_flake: path to flake to be checked
@@ -83,7 +83,9 @@ def get_derivations(path_to_flake: str) -> list[str]:
if nix_path is None:
status_msg = "nix is not available in the PATH, please verify that it is installed"
raise RuntimeError(status_msg)
flake_show = bash_wrapper(f"{nix_path} flake show --json --accept-flake-path", path=path_to_flake)
cmd = f"{nix_path} flake show --json --accept-flake-path"
cmd += " --allow-import-from-derivation" if allow_import_from_derivation else ""
flake_show = bash_wrapper(cmd, path=path_to_flake)
if flake_show[2] != 0:
logger.error("flake show returned non-zero exit code")
logger.warning("falling back to full evaluation via nix flake check")

View File

@@ -99,7 +99,7 @@ def build_or_eval(args: Namespace) -> None:
"""
flake_path = args.flake_path
derivations, hydra_jobs = partition(
lambda s: s.startswith("hydraJobs"), get_derivations(flake_path)
lambda s: s.startswith("hydraJobs"), get_derivations(flake_path, args["allow-import-from-derivation"])
)
derivations, hydra_jobs = list(derivations), list(hydra_jobs)
logger.info(f"derivations: {list(derivations)}")