1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Make config.nix shims

As requested in https://github.com/NixOS/nix/pull/11792#discussion_r1827034428
This commit is contained in:
John Ericson 2024-11-03 17:22:12 -05:00
parent e70c9bb06a
commit f7591bc6ed
56 changed files with 49 additions and 77 deletions

View file

@ -0,0 +1,2 @@
# Shim to get generated file
import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/ca/config.nix"

View file

@ -1,4 +1,4 @@
with import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/ca/config.nix";
with import ./config.nix;
let mkCADerivation = args: mkDerivation ({
__contentAddressed = true;

View file

@ -6,7 +6,4 @@ flakeDir="$TEST_HOME/flake"
mkdir -p "${flakeDir}"
cp flake.nix "${_NIX_TEST_BUILD_DIR}/ca/config.nix" content-addressed.nix "${flakeDir}"
# `config.nix` cannot be gotten via build dir / env var (runs afoul pure eval). Instead get from flake.
removeBuildDirRef "$flakeDir"/*.nix
nix run --no-write-lock-file "path:${flakeDir}#runnable"

View file

@ -1,4 +1,4 @@
with import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/ca/config.nix";
with import ./config.nix;
let mkCADerivation = args: mkDerivation ({
__contentAddressed = true;

View file

@ -2,7 +2,7 @@
# build it at once.
with import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/ca/config.nix";
with import ./config.nix;
mkDerivation {
name = "simple";