From: Csepp <raingloom@riseup.net>
To: Mohamed Amine LEGHERABA <mlegheraba@protonmail.com>
Cc: Csepp <raingloom@riseup.net>, "(" <paren@disroot.org>, help-guix@gnu.org
Subject: Re: How to use/install rust nightly on guix ?
Date: Mon, 31 Oct 2022 02:05:54 +0100 [thread overview]
Message-ID: <87o7tshk4q.fsf@riseup.net> (raw)
In-Reply-To: <Gz53IFntvYWgAorjs88J59LD-5PEZcXEA3n3Qnx_WIjCP2ZlV1sIdhhdfuKcrG3GN4NEsrfp1gzudDoVf7hzK-R9ObuJmvhpB_lvqkMPr7I=@protonmail.com>
[-- Attachment #1: Type: text/plain, Size: 320 bytes --]
Mohamed Amine LEGHERABA <mlegheraba@protonmail.com> writes:
> Yes Csepp I'm interested by your tutoriel on how to create a chroot
> Arch on Guix, It will allow me to run several "exotic"
> languages/programs on my computer (including rust nigthly).
>
> Thanks,
> Mohamed Amine LEGHERABA
Here is the current version.
[-- Attachment #2: rubber duck debug log --]
[-- Type: text/plain, Size: 2473 bytes --]
=> https://bugs.archlinux.org/task/46169
Download bootstrap chroot
=> http://quantum-mirror.hu/mirrors/pub/archlinux/iso/2021.11.01/archlinux-bootstrap-2021.11.01-x86_64.tar.gz
Extract it somewhere.
Final boot script.
Important!!! Run with `sudo -E`. The "-E" is important. Or just hardcode the path to your home directory.
```
#!/bin/sh
set -ex
cd "$(dirname "$0")"
mount --bind root.x86_64 root.x86_64
mount -o bind "$HOME" root.x86_64/home/user/host-home
# delete these two if you are not using Guix, or modify them if you are using Nix
mount -o bind,ro /gnu/store root.x86_64/gnu/store
mount -o bind,ro /var/guix root.x86_64/var/guix
bash root.x86_64/bin/arch-chroot root.x86_64 /bin/env -i bash -l
# again, delete them
umount -l root.x86_64/var/guix
umount -l root.x86_64/gnu/store
umount -l root.x86_64/home/user/host-home
umount -l root.x86_64
```
First time, on the host system:
```
# write down this number, it will be important
echo $UID
sudo mount --bind root.x86_64 root.x86_64
sudo bash root.x86_64/bin/arch-chroot root.x86_64 /bin/env -i bash -l
```
First time setup inside guest:
```
# enable some mirrors
sed -i 's/^#\(.*\.hu.*\)/\1/' /etc/pacman.d/mirrorlist
# set up timezone
ln -s /usr/share/zoneinfo/Europe/Budapest /etc/localtime
# initalize package manager
pacman-key --init
pacman-key --populate archlinux
# install development packages
pacman -Syu --needed git base-devel
# optional if you are using Guix, otherwise not really:
pacman -S base
# (if you are using Guix or Nix, you can just mount their store and use their packages)
# create store mount point
mkdir -p /gnu/store
mkdir -p /var/guix
# create a non-root user. the UID thing is important, it lets you share your host's home directory in the guest.
useradd -m -u $UID_OF_HOST_USER user
# optional: ignore all security precautions and enable passwordless sudo for this user?
# maybe don't do this?
echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# alternatively, add a password
usermod -aG wheel user
passwd user
echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers
# change to a login shell of the new user
su -l user
# create host home mount
mkdir ~/host-home
# install yay
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
# now you can install anything, like, say, Infer.
yay -Sy infer
# link to host guix. ignore if your host system isn't Guix.
(cd ~/.config; ln -s ../host-home/.config/guix ~/.config/guix)
ln -s host-home/.guix-profile ~/.guix-profile/
```
[-- Attachment #3: Type: text/plain, Size: 309 bytes --]
I wrote it in a way that is hopefully usable to others, but it's still
not exactly a polished how-to guide, so if you have any questions, feel
free to ask them.
There are a bunch of gotchas that I probably forgot to mention, like how
having Guix's environment variables active can mess with Arch's
upgrades.
next prev parent reply other threads:[~2022-10-31 1:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-29 12:29 How to use/install rust nightly on guix ? Mohamed Amine LEGHERABA via
2022-10-29 12:31 ` (
2022-10-29 16:13 ` Csepp
2022-10-29 20:57 ` Re : " Mohamed Amine LEGHERABA
2022-10-31 1:05 ` Csepp [this message]
2022-10-29 18:08 ` Sergiu Ivanov
2022-11-01 10:04 ` phodina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o7tshk4q.fsf@riseup.net \
--to=raingloom@riseup.net \
--cc=help-guix@gnu.org \
--cc=mlegheraba@protonmail.com \
--cc=paren@disroot.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).