select: drop unused nixpkgs fallback
This commit is contained in:
@@ -720,7 +720,7 @@ class Flake:
|
|||||||
AssertionError: If the cache or flake cache path is not properly initialized.
|
AssertionError: If the cache or flake cache path is not properly initialized.
|
||||||
"""
|
"""
|
||||||
from clan_lib.cmd import Log, RunOpts, run
|
from clan_lib.cmd import Log, RunOpts, run
|
||||||
from clan_lib.dirs import nixpkgs_source, select_source
|
from clan_lib.dirs import select_source
|
||||||
from clan_lib.nix import (
|
from clan_lib.nix import (
|
||||||
nix_build,
|
nix_build,
|
||||||
nix_config,
|
nix_config,
|
||||||
@@ -739,20 +739,6 @@ class Flake:
|
|||||||
|
|
||||||
config = nix_config()
|
config = nix_config()
|
||||||
|
|
||||||
# these hashes should be filled in by `nix build`
|
|
||||||
# if we run this Python code directly then we use a fallback
|
|
||||||
# method to getting the NAR hash
|
|
||||||
fallback_nixpkgs_hash = "@fallback_nixpkgs_hash@"
|
|
||||||
if not fallback_nixpkgs_hash.startswith("sha256-"):
|
|
||||||
fallback_nixpkgs = Flake(
|
|
||||||
str(nixpkgs_source()), nix_options=self.nix_options
|
|
||||||
)
|
|
||||||
fallback_nixpkgs.invalidate_cache()
|
|
||||||
assert fallback_nixpkgs.hash is not None, (
|
|
||||||
"this should be impossible as invalidate_cache() should always set `hash`"
|
|
||||||
)
|
|
||||||
fallback_nixpkgs_hash = fallback_nixpkgs.hash
|
|
||||||
|
|
||||||
select_hash = "@select_hash@"
|
select_hash = "@select_hash@"
|
||||||
if not select_hash.startswith("sha256-"):
|
if not select_hash.startswith("sha256-"):
|
||||||
select_flake = Flake(str(select_source()), nix_options=self.nix_options)
|
select_flake = Flake(str(select_source()), nix_options=self.nix_options)
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ let
|
|||||||
rm -f $out/clan_lib/select
|
rm -f $out/clan_lib/select
|
||||||
|
|
||||||
substituteInPlace $out/clan_lib/flake/flake.py \
|
substituteInPlace $out/clan_lib/flake/flake.py \
|
||||||
--replace-fail '@fallback_nixpkgs_hash@' "$(jq -r '.nodes.nixpkgs.locked.narHash' ${nixpkgs'}/flake.lock)" \
|
|
||||||
--replace-fail '@select_hash@' "$(jq -r '.nodes."nix-select".locked.narHash' ${../../flake.lock})"
|
--replace-fail '@select_hash@' "$(jq -r '.nodes."nix-select".locked.narHash' ${../../flake.lock})"
|
||||||
ln -sf ${nixpkgs'} $out/clan_lib/nixpkgs
|
ln -sf ${nixpkgs'} $out/clan_lib/nixpkgs
|
||||||
ln -sf ${nix-select} $out/clan_lib/select
|
ln -sf ${nix-select} $out/clan_lib/select
|
||||||
|
|||||||
Reference in New Issue
Block a user