extend message about nixOS shell

This commit is contained in:
Maciej Krüger 2021-06-21 09:12:15 +02:00
parent 8e48b6fd74
commit 49fc87f385
No known key found for this signature in database
GPG key ID: 0D948CE19CF49C5F
2 changed files with 7 additions and 2 deletions

1
mach
View file

@ -110,6 +110,7 @@ if __name__ == '__main__':
import subprocess import subprocess
from shlex import quote from shlex import quote
mach_dir = os.path.abspath(os.path.dirname(__file__)) mach_dir = os.path.abspath(os.path.dirname(__file__))
print('NOTE: Entering nix-shell etc/shell.nix')
try: try:
# sys argv already contains the ./mach part, so we just need to pass it as-is # sys argv already contains the ./mach part, so we just need to pass it as-is
subprocess.Popen(['nix-shell', mach_dir + '/etc/shell.nix', '--run', ' '.join(map(quote, sys.argv))]).wait() subprocess.Popen(['nix-shell', mach_dir + '/etc/shell.nix', '--run', ' '.join(map(quote, sys.argv))]).wait()

View file

@ -400,8 +400,12 @@ def bootstrap(context, force=False, specific=None):
distrib, version = get_linux_distribution() distrib, version = get_linux_distribution()
if distrib.lower() == 'nixos': if distrib.lower() == 'nixos':
print('NixOS does not need bootstrap') print('NixOS does not need bootstrap, it will automatically enter a nix-shell')
print('just run ./mach build') print('Just run ./mach build')
print('')
print('You will need to run a nix-shell if you are trying to run any of the built binaries')
print('To enter the nix-shell manually use:')
print(' $ nix-shell etc/shell.nix')
return return
context.distro = distrib context.distro = distrib