From: Julien Lepiller <julien@lepiller.eu>
To: help-guix@gnu.org, 宋文武 <iyzsong@envs.net>,
"Rodrigo Morales" <moralesrodrigo1100@gmail.com>
Subject: Re: Newbie question: Why my system has so many shells.scm files?
Date: Sun, 05 Mar 2023 08:06:59 +0100 [thread overview]
Message-ID: <7F184C0C-2BD3-41D2-AC40-E1A46B302CD8@lepiller.eu> (raw)
In-Reply-To: <87mt4snh3m.fsf@envs.net>
Another possibility is to use guix gc -R `readlink -f /path/to/a/profile`. Note that you have multiple profiles (system, user, pull, maybe home).
The command lists all live paths under a given store path. In this case, all that is accessible to the profile you asked for. It's granularity is the store path, not exact files, so even a store path is live and has a shells.scm in it, doesn't mean it's actually used.
Also, the shells.scm you found can be split in two categories. There are two different guile modules:
(gnu packages shells) has packages related to shells (bash, zsh, …)
(gnu home services shells) has service definitions for guix home that are related to shells (creating a bashrc for instance)
Some of the store paths you mention seem to be sources that could probably be garbage collected.
Le 5 mars 2023 02:04:45 GMT+01:00, "宋文武" <iyzsong@envs.net> a écrit :
>Rodrigo Morales <moralesrodrigo1100@gmail.com> writes:
>
>> Table of Contents
>> _________________
>>
>> 1. The context
>> 2. The question
>>
>>
>> 1 The context
>> =============
>>
>> Newbie user here. I'm curious about how `home-bash-configuration'
>> works, so I wanted to jump to its definition. I know that one way of
>> doing this is cloning the Guix repository and executing grep to search
>> that string. In fact, I did this and found it in
>> `gnu/home/services/shells.scm'.
>>
>> Using common sense, I knew that that file also existed in my system,
>> so I was wondering how I could have accomplished the same objective
>> without having to download the Git repository, just in case some day I
>> don't have internet connection
>>
>> ,----
>> | locate shells.scm | grep '/gnu/store'
>> `----
>> [...]
>>
>> 2 The question
>> ==============
>>
>> How to know which of these files is currently being used by my
>> system? I'm sure not all of them are being used. I'm somewhat
>> familiar with how generations work, but in other words, I'd like to
>> know how to determine which of these files is the one that is being
>> used by the current generation.
>
>First to find out what files are currently going to be used the system:
>
> $ guix repl
> > %load-path
>
>I got:
>```
>$1 = ("/gnu/store/sg5mf194lisl59b1bm3a7x6llf3vvhlv-guix-module-union/share/guile/site/3.0" "/gnu/store/qbqdkziw7222077fn4z2x5n91185ivis-guile-3.0.9/share/guile/3.0" "/gnu/store/qbqdkziw7222077fn4z2x5n91185ivis-guile-3.0.9/share/guile/3.0" "/gnu/store/qbqdkziw7222077fn4z2x5n91185ivis-guile-3.0.9/share/guile/site/3.0" "/gnu/store/qbqdkziw7222077fn4z2x5n91185ivis-guile-3.0.9/share/guile/site" "/gnu/store/qbqdkziw7222077fn4z2x5n91185ivis-guile-3.0.9/share/guile" "/home/iyzsong/.config/guix/current/share/guile/site/3.0" "/run/current-system/profile/share/guile/site/3.0"
>```
>
>In the first directory, it has:
> /gnu/store/sg5mf194lisl59b1bm3a7x6llf3vvhlv-guix-module-union/share/guile/site/3.0/gnu/home/services/shells.scm
>
>These scm files are guile modules, which will be used by the time 'guix' run.
>
>
>And to find out what the current generation are using, first you need to
>find out what guix version(s) being used.
>For system profile, /run/current-system/provenace or
>/run/current-system/channels.scm has the version (guix commit) info.
>For user profile, ~/.guix-profile/manifest have it in the provenance property.
>
>Then given the commit, how to get the files?
>
>If you 'guix pull' before as I did, it can be:
>```
>cd ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq
>git checkout -f ${COMMIT}
>```
>
>Or 'guix pull --commit ${COMMIT}', or git clone a new guix repository...
>
>
>Hope this helps!
>
prev parent reply other threads:[~2023-03-05 7:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-04 17:32 Newbie question: Why my system has so many shells.scm files? Rodrigo Morales
2023-03-05 1:04 ` 宋文武
2023-03-05 7:06 ` Julien Lepiller [this message]
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=7F184C0C-2BD3-41D2-AC40-E1A46B302CD8@lepiller.eu \
--to=julien@lepiller.eu \
--cc=help-guix@gnu.org \
--cc=iyzsong@envs.net \
--cc=moralesrodrigo1100@gmail.com \
/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).