add NixOS support to mach and automatically re-launch mach in nix-shell

This commit is contained in:
Maciej Krüger 2021-05-31 17:57:43 +02:00
parent 2cade89ede
commit 8e48b6fd74
No known key found for this signature in database
GPG key ID: 0D948CE19CF49C5F
2 changed files with 17 additions and 1 deletions

View file

@ -383,6 +383,7 @@ def get_linux_distribution():
'debian gnu/linux',
'fedora',
'void',
'nixos',
]:
raise Exception('mach bootstrap does not support %s, please file a bug' % distrib)
@ -398,6 +399,11 @@ def bootstrap(context, force=False, specific=None):
elif "linux-gnu" in host_triple():
distrib, version = get_linux_distribution()
if distrib.lower() == 'nixos':
print('NixOS does not need bootstrap')
print('just run ./mach build')
return
context.distro = distrib
context.distro_version = version
bootstrapper = LINUX_SPECIFIC_BOOTSTRAPPERS.get(specific, linux)