clan_lib flake: get select output without nixpkgs
This commit is contained in:
@@ -744,16 +744,35 @@ class Flake:
|
|||||||
)
|
)
|
||||||
select_hash = select_flake.hash
|
select_hash = select_flake.hash
|
||||||
|
|
||||||
|
# fmt: off
|
||||||
nix_code = f"""
|
nix_code = f"""
|
||||||
let
|
let
|
||||||
flake = builtins.getFlake "path:{self.store_path}?narHash={self.hash}";
|
flake = builtins.getFlake "path:{self.store_path}?narHash={self.hash}";
|
||||||
selectLib = (builtins.getFlake "path:{select_source()}?narHash={select_hash}").lib;
|
selectLib = (
|
||||||
nixpkgs = flake.inputs.nixpkgs or (builtins.getFlake "path:{nixpkgs_source()}?narHash={fallback_nixpkgs_hash}");
|
builtins.getFlake
|
||||||
|
"path:{select_source()}?narHash={select_hash}"
|
||||||
|
).lib;
|
||||||
in
|
in
|
||||||
nixpkgs.legacyPackages.{config["system"]}.writeText "clan-flake-select" (
|
derivation {{
|
||||||
builtins.toJSON [ {" ".join([f"(selectLib.applySelectors (builtins.fromJSON ''{attr}'') flake)" for attr in str_selectors])} ]
|
name = "clan-flake-select";
|
||||||
)
|
system = "{config["system"]}";
|
||||||
|
builder = "/bin/sh";
|
||||||
|
args = [
|
||||||
|
"-c"
|
||||||
|
''
|
||||||
|
printf %s '${{builtins.toJSON [
|
||||||
|
{" ".join(
|
||||||
|
[
|
||||||
|
f"(selectLib.applySelectors (builtins.fromJSON ''{attr}'') flake)"
|
||||||
|
for attr in str_selectors
|
||||||
|
]
|
||||||
|
)}
|
||||||
|
]}}' > $out
|
||||||
|
''
|
||||||
|
];
|
||||||
|
}}
|
||||||
"""
|
"""
|
||||||
|
# fmt: on
|
||||||
if tmp_store := nix_test_store():
|
if tmp_store := nix_test_store():
|
||||||
nix_options += ["--store", str(tmp_store)]
|
nix_options += ["--store", str(tmp_store)]
|
||||||
nix_options.append("--impure")
|
nix_options.append("--impure")
|
||||||
|
|||||||
Reference in New Issue
Block a user