* Newbie question: Why my system has so many shells.scm files?
@ 2023-03-04 17:32 Rodrigo Morales
2023-03-05 1:04 ` 宋文武
0 siblings, 1 reply; 3+ messages in thread
From: Rodrigo Morales @ 2023-03-04 17:32 UTC (permalink / raw)
To: help-guix
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'
`----
,----
|
/gnu/store/0ywmx3mj3y644mas5v6c8a0h59xz6kid-guix-3809aa0/gnu/home/services/shells.scm
|
/gnu/store/0ywmx3mj3y644mas5v6c8a0h59xz6kid-guix-3809aa0/gnu/packages/shells.scm
|
/gnu/store/5kj8lyybjrdl7xd0fx9g9vzkz8sklqsy-guix-1.4.0/share/guile/site/3.0/gnu/home/services/shells.scm
|
/gnu/store/5kj8lyybjrdl7xd0fx9g9vzkz8sklqsy-guix-1.4.0/share/guile/site/3.0/gnu/packages/shells.scm
|
/gnu/store/7w4ln207ylgaqbj6crb9x234kypb1in4-guix-b12ee1ee5-modules/share/guile/site/3.0/gnu/packages/shells.scm
|
/gnu/store/8l8z4i57xwcnjnh66773g8sgf19lrxcq-guix-packages-base-source/gnu/packages/shells.scm
|
/gnu/store/9nvx97hr8kkr26gzwni2fblfn0yq0xjw-guix-1.4.0rc2/share/guile/site/3.0/gnu/home/services/shells.scm
|
/gnu/store/9nvx97hr8kkr26gzwni2fblfn0yq0xjw-guix-1.4.0rc2/share/guile/site/3.0/gnu/packages/shells.scm
|
/gnu/store/b6mhxbzibqv7v66frjlqg21s38pvplh5-guix-b12ee1e/gnu/home/services/shells.scm
|
/gnu/store/b6mhxbzibqv7v66frjlqg21s38pvplh5-guix-b12ee1e/gnu/packages/shells.scm
|
/gnu/store/b8kb2yrrxpqgvviryx5vd4v8b66wdx12-guix-3809aa01a-modules/share/guile/site/3.0/gnu/packages/shells.scm
|
/gnu/store/bn45df51vizkrqwkca3g177gq8d19spx-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/home/services/shells.scm
|
/gnu/store/bn45df51vizkrqwkca3g177gq8d19spx-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/packages/shells.scm
|
/gnu/store/dgjgpx2gflf1lqr3jipr6jclkmn7qh8j-guix-1.4.0rc2/share/guile/site/3.0/gnu/home/services/shells.scm
|
/gnu/store/dgjgpx2gflf1lqr3jipr6jclkmn7qh8j-guix-1.4.0rc2/share/guile/site/3.0/gnu/packages/shells.scm
|
/gnu/store/faxxz91yljsfpbjwx5l35ipnlkpa4khl-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/home/services/shells.scm
|
/gnu/store/faxxz91yljsfpbjwx5l35ipnlkpa4khl-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/packages/shells.scm
|
/gnu/store/prm3kzg3rm0klf4zp6bdxpx9iwjc0dsb-guix-home-source/gnu/home/services/shells.scm
|
/gnu/store/xzaa4wgw8l6lmfi0zcp4m74ihkl0nwh4-guix-packages-base-source/gnu/packages/shells.scm
|
/home/rdrg/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/gnu/home/services/shells.scm
|
/home/rdrg/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/gnu/packages/shells.scm
`----
I also noticed that some of the found files have the same content (see
output of `sha512sum' below)
,----
| locate shadow.scm | sudo xargs sha512sum
`----
,----
|
230645de4bc3a4f3c177d0e92e432d7cb554acd0e0b30efb02330c749e4f4ae7cef172d4b20388d8b52343396b195d9ebc8838a3027f264035126d40508779c2
/gnu/store/b6mhxbzibqv7v66frjlqg21s38pvplh5-guix-b12ee1e/gnu/home/services/shells.scm
|
230645de4bc3a4f3c177d0e92e432d7cb554acd0e0b30efb02330c749e4f4ae7cef172d4b20388d8b52343396b195d9ebc8838a3027f264035126d40508779c2
/gnu/store/bn45df51vizkrqwkca3g177gq8d19spx-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/home/services/shells.scm
|
230645de4bc3a4f3c177d0e92e432d7cb554acd0e0b30efb02330c749e4f4ae7cef172d4b20388d8b52343396b195d9ebc8838a3027f264035126d40508779c2
/gnu/store/faxxz91yljsfpbjwx5l35ipnlkpa4khl-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/home/services/shells.scm
|
230645de4bc3a4f3c177d0e92e432d7cb554acd0e0b30efb02330c749e4f4ae7cef172d4b20388d8b52343396b195d9ebc8838a3027f264035126d40508779c2
/gnu/store/prm3kzg3rm0klf4zp6bdxpx9iwjc0dsb-guix-home-source/gnu/home/services/shells.scm
|
230645de4bc3a4f3c177d0e92e432d7cb554acd0e0b30efb02330c749e4f4ae7cef172d4b20388d8b52343396b195d9ebc8838a3027f264035126d40508779c2
/home/rdrg/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/gnu/home/services/shells.scm
|
9976184073a8963e93744a5316c6566ae3580762bcbf8af72f88cccc09552ece083cbf30bb0350f06503b1ed55feb93651183d39e803bbfe16c6d466ee883f4d
/gnu/store/bn45df51vizkrqwkca3g177gq8d19spx-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/packages/shells.scm
|
9976184073a8963e93744a5316c6566ae3580762bcbf8af72f88cccc09552ece083cbf30bb0350f06503b1ed55feb93651183d39e803bbfe16c6d466ee883f4d
/gnu/store/faxxz91yljsfpbjwx5l35ipnlkpa4khl-guix-1.4.0-3.d5fece6/share/guile/site/3.0/gnu/packages/shells.scm
|
a25d73685f93abfb848b9aa25f08d416b294a9c697bdb7293d30a31664983dab40e6c1cecad9662a10b5a3704c9c316e08f21717c786fe284f250ae2e6b1d769
/gnu/store/5kj8lyybjrdl7xd0fx9g9vzkz8sklqsy-guix-1.4.0/share/guile/site/3.0/gnu/packages/shells.scm
|
a25d73685f93abfb848b9aa25f08d416b294a9c697bdb7293d30a31664983dab40e6c1cecad9662a10b5a3704c9c316e08f21717c786fe284f250ae2e6b1d769
/gnu/store/9nvx97hr8kkr26gzwni2fblfn0yq0xjw-guix-1.4.0rc2/share/guile/site/3.0/gnu/packages/shells.scm
|
a25d73685f93abfb848b9aa25f08d416b294a9c697bdb7293d30a31664983dab40e6c1cecad9662a10b5a3704c9c316e08f21717c786fe284f250ae2e6b1d769
/gnu/store/dgjgpx2gflf1lqr3jipr6jclkmn7qh8j-guix-1.4.0rc2/share/guile/site/3.0/gnu/packages/shells.scm
|
d9bfd1d416e592a6fb7bf07c71a9d84f744b5b04f54adb20de3450e923e255e03e1c4a832e7ec5b74b3a9e78d75ffe99531fb969acac1899a001040ac176bec2
/gnu/store/0ywmx3mj3y644mas5v6c8a0h59xz6kid-guix-3809aa0/gnu/packages/shells.scm
|
d9bfd1d416e592a6fb7bf07c71a9d84f744b5b04f54adb20de3450e923e255e03e1c4a832e7ec5b74b3a9e78d75ffe99531fb969acac1899a001040ac176bec2
/gnu/store/7w4ln207ylgaqbj6crb9x234kypb1in4-guix-b12ee1ee5-modules/share/guile/site/3.0/gnu/packages/shells.scm
|
d9bfd1d416e592a6fb7bf07c71a9d84f744b5b04f54adb20de3450e923e255e03e1c4a832e7ec5b74b3a9e78d75ffe99531fb969acac1899a001040ac176bec2
/gnu/store/8l8z4i57xwcnjnh66773g8sgf19lrxcq-guix-packages-base-source/gnu/packages/shells.scm
|
d9bfd1d416e592a6fb7bf07c71a9d84f744b5b04f54adb20de3450e923e255e03e1c4a832e7ec5b74b3a9e78d75ffe99531fb969acac1899a001040ac176bec2
/gnu/store/b6mhxbzibqv7v66frjlqg21s38pvplh5-guix-b12ee1e/gnu/packages/shells.scm
|
d9bfd1d416e592a6fb7bf07c71a9d84f744b5b04f54adb20de3450e923e255e03e1c4a832e7ec5b74b3a9e78d75ffe99531fb969acac1899a001040ac176bec2
/gnu/store/b8kb2yrrxpqgvviryx5vd4v8b66wdx12-guix-3809aa01a-modules/share/guile/site/3.0/gnu/packages/shells.scm
|
d9bfd1d416e592a6fb7bf07c71a9d84f744b5b04f54adb20de3450e923e255e03e1c4a832e7ec5b74b3a9e78d75ffe99531fb969acac1899a001040ac176bec2
/gnu/store/xzaa4wgw8l6lmfi0zcp4m74ihkl0nwh4-guix-packages-base-source/gnu/packages/shells.scm
|
d9bfd1d416e592a6fb7bf07c71a9d84f744b5b04f54adb20de3450e923e255e03e1c4a832e7ec5b74b3a9e78d75ffe99531fb969acac1899a001040ac176bec2
/home/rdrg/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/gnu/packages/shells.scm
|
e6aef84a45657e0f1b8d386801c311fdbea672d9d7d8d11b4c5a2ec60e29a9d4226d31b23cabc32156ac6cc6d0f335e3fb8be9f448835710978f47b5be6e84cf
/gnu/store/5kj8lyybjrdl7xd0fx9g9vzkz8sklqsy-guix-1.4.0/share/guile/site/3.0/gnu/home/services/shells.scm
|
e6aef84a45657e0f1b8d386801c311fdbea672d9d7d8d11b4c5a2ec60e29a9d4226d31b23cabc32156ac6cc6d0f335e3fb8be9f448835710978f47b5be6e84cf
/gnu/store/9nvx97hr8kkr26gzwni2fblfn0yq0xjw-guix-1.4.0rc2/share/guile/site/3.0/gnu/home/services/shells.scm
|
e6aef84a45657e0f1b8d386801c311fdbea672d9d7d8d11b4c5a2ec60e29a9d4226d31b23cabc32156ac6cc6d0f335e3fb8be9f448835710978f47b5be6e84cf
/gnu/store/dgjgpx2gflf1lqr3jipr6jclkmn7qh8j-guix-1.4.0rc2/share/guile/site/3.0/gnu/home/services/shells.scm
`----
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Newbie question: Why my system has so many shells.scm files?
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
0 siblings, 1 reply; 3+ messages in thread
From: 宋文武 @ 2023-03-05 1:04 UTC (permalink / raw)
To: Rodrigo Morales; +Cc: help-guix
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!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Newbie question: Why my system has so many shells.scm files?
2023-03-05 1:04 ` 宋文武
@ 2023-03-05 7:06 ` Julien Lepiller
0 siblings, 0 replies; 3+ messages in thread
From: Julien Lepiller @ 2023-03-05 7:06 UTC (permalink / raw)
To: help-guix, 宋文武, Rodrigo Morales
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!
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-05 7:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).