* Experience using the Nix service as a novice user
@ 2024-02-04 20:02 Christian Miller
2024-02-06 13:18 ` [bug#68950] [PATCH] doc: Document required setup steps for Nix service Carlo Zancanaro
2024-02-06 13:22 ` Experience using the Nix service as a novice user Carlo Zancanaro
0 siblings, 2 replies; 5+ messages in thread
From: Christian Miller @ 2024-02-04 20:02 UTC (permalink / raw)
To: guix-devel
Hello,
I wanted to try out the Nix service and followed the manual. I had
some trouble while doing so. The following are the steps I took, the
errors I encountered, and how I resolved them. As well as feedback to
the experience.
I added the nix-service-type and nix package itself according to the
Guix manual.
(use-modules (gnu))
(use-service-modules nix)
(use-package-modules package-management)
(operating-system
;; …
(packages (append (list nix)
%base-packages))
(services (append (list (service nix-service-type))
%base-services)))
Those two commands are not provided by the manual. Instead the manual
just references to the Nix manual. It would be better to just provide
those two commands, since the Nix manual was not helpful. This
website[0] was more helpful.
nix-channel --add https://nixos.org/channels/nixos-23.11 nixos
nix-channel --update
At this point, I started encountering problems. The command
"nix-channel --update" returns:
unpacking channels...
error: opening pseudoterminal master: No such device
error: program
'/gnu/store/mh2nc81cvw321q0lx4y38g4n7b86q88y-nix-2.16.1/bin/nix-env'
failed with exit code 1
This was easy to fix because I had found this solution[1]
sudo herd restart nix-daemon
Now I reran "nix-channel --update" and it worked. After this, I was
going on with the manual which said:
ln -s "/nix/var/nix/profiles/per-user/$USER/profile" ~/.nix-profile
source /run/current-system/profile/etc/profile.d/nix.sh
At this point, I thought I would be done, as I had followed all the
steps in the manual. Therefore I tried to install a package.
nix-env --install mpv
However, this did not work as I encountered the following error:
error: opening lock file
'/nix/var/nix/profiles/per-user/cm/profile.lock': No such file or
directory
To resolve this, I executed the following command:
sudo mkdir /nix/var/nix/profiles/per-user/$USER
which resulted in another error because I forgot to set the
permissions:
error: opening lock file
'/nix/var/nix/profiles/per-user/cm/profile.lock': Permission
denied
Therefore, I also executed the following command:
sudo chown -R $USER:users /nix/var/nix/profiles/per-user/$USER
Now I could install the Nix version of mpv with
nix-env --install mpv
I initially attempted this within a VM ($(guix system vm nix.scm) -m
4096 -smp 2) that had 4 GiB of memory and 2 cores. The process was
terminated. Is it normal for Nix to require such a large amount of
resources to install a package? It might be helpful to include this
information in the guide, as I was unsure whether there was a problem
with the installation or if 4 GiB of memory was insufficient.
Therefore, I tried it on my machine, which has 16 GiB of memory, and
it worked.
Overall, it feels not very well supported. As a novice user, I found
the process to be quite challenging. Additionally, I was hoping for a
"working out of the box" experience, which unfortunately was not the
case with the Nix service.
[0] https://nixos.wiki/wiki/Nix_channels
[1] https://issues.guix.gnu.org/63546#7
--
Christian Miller
^ permalink raw reply [flat|nested] 5+ messages in thread
* [bug#68950] [PATCH] doc: Document required setup steps for Nix service.
2024-02-04 20:02 Experience using the Nix service as a novice user Christian Miller
@ 2024-02-06 13:18 ` Carlo Zancanaro
2024-02-27 10:24 ` bug#68950: " Ludovic Courtès
2024-02-06 13:22 ` Experience using the Nix service as a novice user Carlo Zancanaro
1 sibling, 1 reply; 5+ messages in thread
From: Carlo Zancanaro @ 2024-02-06 13:18 UTC (permalink / raw)
To: 68950; +Cc: christian.miller
* doc/guix.texi (Nix service): Add specific channel setup commands, add
commands to create profile directory.
---
doc/guix.texi | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index b76df868f8..0ac245a376 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -40313,16 +40313,31 @@ Miscellaneous Services
@itemize
@item Add a Nix channel and update it. See
-@url{https://nixos.org/nix/manual/, Nix Package Manager Guide}.
+@url{https://nixos.wiki/wiki/Nix_channels, Nix channels} for more
+information about the available channels. If you would like to use the
+unstable Nix channel you can do this by running:
+
+@example
+$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
+$ nix-channel --update
+@end example
+
+@item Create your Nix profile directory:
+
+@example
+$ sudo mkdir -p /nix/var/nix/profiles/per-user/$USER
+$ sudo chown $USER:root /nix/var/nix/profiles/per-user/$USER
+@end example
@item Create a symlink to your profile and activate Nix profile:
-@end itemize
@example
$ ln -s "/nix/var/nix/profiles/per-user/$USER/profile" ~/.nix-profile
$ source /run/current-system/profile/etc/profile.d/nix.sh
@end example
+@end itemize
+
@end defvar
@deftp {Data Type} nix-configuration
base-commit: a4464bd0975c811f18af98f69032b29bddda5b81
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Experience using the Nix service as a novice user
2024-02-04 20:02 Experience using the Nix service as a novice user Christian Miller
2024-02-06 13:18 ` [bug#68950] [PATCH] doc: Document required setup steps for Nix service Carlo Zancanaro
@ 2024-02-06 13:22 ` Carlo Zancanaro
2024-02-26 19:41 ` Christian Miller
1 sibling, 1 reply; 5+ messages in thread
From: Carlo Zancanaro @ 2024-02-06 13:22 UTC (permalink / raw)
To: Christian Miller; +Cc: guix-devel
Hi Christian!
On Sun, Feb 04 2024, Christian Miller wrote:
> I wanted to try out the Nix service and followed the manual. I had
> some trouble while doing so. The following are the steps I took, the
> errors I encountered, and how I resolved them. As well as feedback to
> the experience.
Thank you for this feedback!
I recently installed the Nix service myself, and ran into these rough
edges, but I didn't think to write them down or fix things. Thank you
for the clear and detailed prompt to do so.
I've just sent a patch to guix-patches with some updates to the manual
which attempts to add the pieces that you found were missing. Could you
have a look at that and make sure you're happy with what I've written?
> At this point, I started encountering problems. The command
> "nix-channel --update" returns:
>
> unpacking channels...
> error: opening pseudoterminal master: No such device
> error: program
> '/gnu/store/mh2nc81cvw321q0lx4y38g4n7b86q88y-nix-2.16.1/bin/nix-env'
> failed with exit code 1
>
> This was easy to fix because I had found this solution[1]
>
> sudo herd restart nix-daemon
I didn't mention this in the manual, because this seems more like a bug
that should be fixed. I've also had the same issue, so I'll try to
investigate the next time it happens to see if I can fix it.
> I initially attempted this within a VM ($(guix system vm nix.scm) -m
> 4096 -smp 2) that had 4 GiB of memory and 2 cores. The process was
> terminated. Is it normal for Nix to require such a large amount of
> resources to install a package?
I wouldn't expect it to need that much, unless it was needing to build
things from source. Usually Nix's substitute coverage is pretty good, so
I wouldn't expect you to need to build much from source.
Carlo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-27 12:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 20:02 Experience using the Nix service as a novice user Christian Miller
2024-02-06 13:18 ` [bug#68950] [PATCH] doc: Document required setup steps for Nix service Carlo Zancanaro
2024-02-27 10:24 ` bug#68950: " Ludovic Courtès
2024-02-06 13:22 ` Experience using the Nix service as a novice user Carlo Zancanaro
2024-02-26 19:41 ` Christian Miller
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.