help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question: Why my system has so many shells.scm files?


From: 宋文武
Subject: Re: Newbie question: Why my system has so many shells.scm files?
Date: Sun, 05 Mar 2023 09:04:45 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

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!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]