Skip to content

Commit

Permalink
Remove most of <nix/config.nix>
Browse files Browse the repository at this point in the history
This is no longer needed.
  • Loading branch information
edolstra committed Nov 26, 2019
1 parent 045708d commit 6a9c815
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -86,6 +86,7 @@ perl/Makefile.config
/tests/restricted-innocent
/tests/shell
/tests/shell.drv
/tests/config.nix

# /tests/lang/
/tests/lang/*.out
Expand Down
8 changes: 0 additions & 8 deletions corepkgs/config.nix.in
Expand Up @@ -4,14 +4,6 @@ let
let val = builtins.getEnv var; in
if val != "" then val else def;
in rec {
shell = "@bash@";
coreutils = "@coreutils@";
bzip2 = "@bzip2@";
gzip = "@gzip@";
xz = "@xz@";
tar = "@tar@";
tarFlags = "@tarFlags@";
tr = "@tr@";
nixBinDir = fromEnv "NIX_BIN_DIR" "@bindir@";
nixPrefix = "@prefix@";
nixLibexecDir = fromEnv "NIX_LIBEXEC_DIR" "@libexecdir@";
Expand Down
6 changes: 2 additions & 4 deletions tests/config.nix → tests/config.nix.in
@@ -1,9 +1,7 @@
with import <nix/config.nix>;

rec {
inherit shell;
shell = "@bash@";

path = coreutils;
path = "@coreutils@";

system = builtins.currentSystem;

Expand Down
2 changes: 1 addition & 1 deletion tests/local.mk
Expand Up @@ -39,4 +39,4 @@ tests-environment = NIX_REMOTE= $(bash) -e

clean-files += $(d)/common.sh

installcheck: $(d)/common.sh $(d)/plugins/libplugintest.$(SO_EXT)
installcheck: $(d)/common.sh $(d)/config.nix $(d)/plugins/libplugintest.$(SO_EXT)

3 comments on commit 6a9c815

@LnL7
Copy link
Member

@LnL7 LnL7 commented on 6a9c815 Jan 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think <nix/config.nix> should be considered a public api that nix currently exposes. It's used in various places outside of nixpkgs and is quite useful for "trivial" derivations in cases where depending on nixpkgs is undesirable.

@zimbatm
Copy link
Member

@zimbatm zimbatm commented on 6a9c815 Jan 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need some stable API to bootstrap a minimal nixpkgs. /bin/sh is available in the sandbox but is quite limited. There is also <nix/fetchurl.nix> that can be used to fetch busybox and re-establish the coreutils.

@edolstra
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need that since the Nixpkgs bootstrap does not rely on /bin/sh or <nix/config.nix>. It downloads its own bootstrap shell using <nix/fetchurl.nix>.

Please sign in to comment.