help-guix
[Top][All Lists]
Advanced

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

Re: I am sorry Re: Help-Guix Digest, Vol 88, Issue 4


From: Tracker
Subject: Re: I am sorry Re: Help-Guix Digest, Vol 88, Issue 4
Date: Fri, 14 Apr 2023 22:08:22 -0400

Gottfried <gottfried@posteo.de> writes:

> Hi,
> I am sorry, I mixed up two questions.
> I was already one thought ahead.
>
> 1. Question about activating all profiles at login time
> 2. Question updating all profiles at once.
>
> 1.
> to avtivate all profiles at once
> You wrote that it would be better to have only one package in one profil.
> So I would have to use each package in a separate profil
>
> Musescore version 4.0.2
> and Musescore version 3.6.2
> are in different profiles,
> so I guess it shouldn’t be a problem
> What do you say?

No, I think you misunderstood me.

I have multiple packages in each of my profiles. This is fine. I would
not make one profile per package. That seems like an abuse of the system
somehow.

The point of a profile is to create an environment in which a particular
group of packages is installed. That's it.

By default, each user on Guix System has one user profile. All packages
that they install are placed into it. This is easy to manage. Some
people (like myself) choose to create additional profiles. Many people
do this in order to separate out a group of packages that they don't
want installed (or upgraded) all the time. I do it because occasionally
one of my packages breaks when I am upgrading my system. By splitting
all of my packages up into a few different profiles by category, if one
package fails to upgrade, then that profile doesn't upgrade, but all of
my other profiles do. This allows me to install the newest software for
everything outside of the broken profile. Then I focus on fixing the
broken package and just upgrade the broken profile. Easy peasy.

> 2.
> To update all profiles at once
> this is a different question, which I have to deal as well.
>
> Is there a way to do it?
>
> Is there a way to exclude the profile "Musik" because this profile I
>  have to upgrade with:
>
>  guix package -p /home/gfp/Projekte/Musik/guix-profil -m
>  /home/gfp/Projekte/Musik/musik.scm
>
>  or put Musescore 3.6.2 in a separate profil,
> but still the question remains, that this profil should then not be
> included in the update process.

I believe I already provided you with the code for updating profiles and
activating them, but here it is again for reference:

```update-profiles.sh
#!/bin/sh

GUIX_MANIFESTS=$HOME/sys/guix/manifests
GUIX_PROFILES=$HOME/sys/guix/profiles

for dir in $GUIX_PROFILES/*
do
    name=$(basename "$dir")
    manifest=$GUIX_MANIFESTS/$name.scm
    profile=$dir/$name
    if [ -r $manifest ]
    then
        guix package --manifest="$manifest" --profile="$profile"
    fi
    unset profile
    unset manifest
    unset name
done
```

```activate-profiles.sh
#!/bin/sh

GUIX_PROFILES=$HOME/sys/guix/profiles

for dir in $GUIX_PROFILES/*
do
    name=$(basename "$dir")
    profile=$dir/$name
    if [ -f "$profile"/etc/profile ]
    then
        GUIX_PROFILE="$profile"
        . "$GUIX_PROFILE"/etc/profile
        export MANPATH="$GUIX_PROFILE/share/man${MANPATH:+:}$MANPATH"
        export INFOPATH="$GUIX_PROFILE/share/info${INFOPATH:+:}$INFOPATH"
    fi
    unset profile
    unset name
done
```

These scripts both loop over my manifests or profiles directories,
running the upgrade or activate commands on each one. If you want to
exclude a profile from being upgraded with this script, you can just
take away its manifest's read permissons like so:

```
chmod -r $HOME/sys/guix/manifests/my-excluded-manifest.scm
```

Good luck,
  Gary

-- 
GPG Key ID: C4FBEDBD
Use `gpg --search-keys tracker@disroot.org' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



reply via email to

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