Re: rolling back only a single package

2018-12-28 Thread cdelia

Hi Pierre,

sorry for double sending it to you, I forgot CC to the list.


On 2018-12-28 04:55, Pierre Neidhardt wrote:
Hi,

I guess you could simply uninstall the offending program:

  guix package -r xmobar


No I can't because xmobar it's the app launcher of my desktop
configuration. Maybe if I switch from xmobar to a launcher that uses:

http://hackage.haskell.org/package/xmonad-contrib-0.15/docs/XMonad-Actions-GridSelect.html

I already use it to switch app-windows and workspaces when they have a
name (other than 1, 2, 3...), with only a couple of haskell code
lines.

But I have to collect all the executables and I'll rather wait and do
it even better: collect all desktops files to not only launch the app,
but to show the icon's ... (idk if that's possible with the current API)

Anyway, it's another subject entirely.

Thanks for answer.



Re: rolling back only a single package

2018-12-28 Thread cdelia

Hi

On 2018-12-28 08:32, swedebugia wrote:

"cde...@dc.uba.ar"  skrev: (27 december 2018
20:52:23 CET)


Hi,

I upgraded guix a couple of days ago, installed some things and now
I
found that xmobar just keeps segfaulting.

Switching to specific generation it's really cool, but in this case
would "uninstall" all the software that it's between the
update-generation and the current one.

So, there is any way to just downgrade a single package (resolving
it
dependencies) with out doing a full switch?

I guess this it's connected to
https://lists.gnu.org/archive/html/help-guix/2016-08/msg00028.html

And I could also switch and then manually re install. But maybe
there is
a standard or automatic way to do it.

Thanks!


Hi.
I highly recommend you to use the declarative way of installing
packages instead. See the manual.



I'm intending to, but before that I rather install when need it, when 
some pseudo complete usable system arise I'll write a declaration.


Declarative it's great, but you have to get in your head all the things 
that you'll need, before even beginning ...



You can use the former xmobar directly from the store if you have it
or you could create an own package/channel that specifies the version
you want.



Well... I never GC nor delete generations. So it should be possible.
But I believe that's a temporal work around that should not be used.

If I don't delete the generation that holds the earlier working version, 
I could do that,
 but then I'll need to use the full path in the store or a symblink 
manually created.


I think that kind of stuff it's a tiny, but accumulative step towards 
chaos. And I'm using git to scape from it XD



The best thing though is to report a bug and help by providing
information e.g. by stracing it. Guide evolves quickly...


It's xmonad, a haskell app. I'm not to proficient in haskell yet to help 
with that.


If I've time I'll report the bug, at least.


--
Sent from my p≡p for Android.




GuixSD Service Implementation Problem

2018-12-28 Thread Reza Alizadeh Majd
Hi, 

I'm working on an application which should be run as a service on GuixSD. 
I followed other service definitions and add my service definition file inside 
`GUIX_PACKAGE_PATH` path. but when I add this service to my system 
configuration file, and perform `guix system reconfigure /etc/config.scm`, 
receive following Error: 

```
ice-9/eval.scm:142:16: In procedure compile-top-call:
error: foo-service: unbound variable
hint: Did you forget `(use-modules (px services foo))'?
```

could anyone help me on this issue?


my system configuration file: 

```
(use-modules (gnu)
 (px services foo))
...

(operating-system
  ...
  
  (services (cons* 
   (foo-service)
   (dhcp-client-service)
   ...
   %base-services))

  (name-service-switch %mdns-host-lookup-nss))
  ```
  
my service definition:

```
(define-module (px services foo)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (px packages foo)
   #:use-module (guix qexp)
   #:use-module (guix records)
   #:use-module (ice-9 match)
   #:export (foo-service))

(define-record-type* 
 foo-configuration  make-foo-configuration
 foo-configuration?
 (package foo-configuration-package
  (default foo-app)))

(define foo-shepherd-service
  (match-lambda
(($  package)
 (list (shepherd-service
 (provision '(foo-service))
 (documentation "foo service")
 (requirement '(user-processes))
 (start #~((make-forkexec-constructor
 (list
   (string-append #$package "/bin/foo_app")
 (stop #~((make-kill-destructor


(define foo-service-type
  (service-type (name 'fooservice)
(extensions
  (list (service-extensions shepherd-root-service-type
foo-shepherd-service)

(define* (foo-service #:key (package foo-app))
 "Foo Service"
 (service foo-service-type
  (foo-configuration
(package package
```
  



Re: rolling back only a single package

2018-12-28 Thread Ricardo Wurmus
Hi cdelia,

Björn wrote:

> There is a nice blog post by Ludivic that describes some aspects of it:
>
> https://www.gnu.org/software/guix/blog/2018/multi-dimensional-transactions-and-rollbacks-oh-my/
>
> It looks like the inferior thing he mentioned is already ready, but I
> haven't yet followed that.

Inferiors work, but you’d use them in manifests.  The idea is to install
the package with an old version of Guix, but to do it in code instead of
manually.  Here’s an example:

--8<---cut here---start->8---
(use-modules (guix inferior) (guix channels)
 (srfi srfi-1))   ;for 'first'

(define channels
  ;; This is the old revision from which we want to
  ;; extract guile-json.
  (list (channel
 (name 'guix)
 (url "https://git.savannah.gnu.org/git/guix.git;)
 (commit
  "65956ad3526ba09e1f7a40722c96c6ef7c0936fe"

(define inferior
  ;; An inferior representing the above revision.
  (inferior-for-channels channels))

;; Now create a manifest with the current "guile" package
;; and the old "guile-json" package.
(packages->manifest
 (list (first (lookup-inferior-packages inferior "guile-json"))
   (specification->package "guile")))
--8<---cut here---end--->8---

You can instantiate the manifest the usual way:

guix package -m /path/to/manifest.scm

--
Ricardo




Re: How to install an old package version?

2018-12-28 Thread Ricardo Wurmus


Hi cdelia,

> How does guix resolves de dependency tree in those cases? Say I need a
> previous package X version, that depends on an earlier package Y
> version that the one that is defined on the "main" guix.

No “resolving” happens.  Guix is a collection of Scheme variables whose
values are package objects.  These package objects refer to the values
of other Scheme variables in Guix.  So a package that depends on
“python” actually references the value of the “python” variable.

This means that replacing a package in the dependency graph requires
more effort.  Adding the package definition itself won’t be enough.  You
would need to use the input rewriting API to rewrite the full dependency
graph of the packages that you are interested in, replacing every
instance of “python” with “my/python” recursively.

Obviously, this would result in packages for which we cannot provide
binaries.

>> Alternatively, you can use a guix git checkout on a specific commit
>> that
>> still has python-2.7.10, but it's probably not what you want.
>
> So, to avoid recursive definition of packages: Could I checkout an
> earlier guix revision, install the package and then checkout the
> latest guix version?
> Would that work or it will bring other kind of dragons?

You can do this in a manifest and using an “inferior” Guix.  See my
other message and/or the manual.  I suggest using manifests for this
instead of doing this manually.

--
Ricardo




Re: Generating System Definitions

2018-12-28 Thread Ricardo Wurmus


Hi cdelia,

> There is a standard way to generate an exportable installer.scm from a
> specific generation?

There is not.  We only go from description to state, never from state
back to the description.

Ideally, your system configuration includes a complete description of
the desired state of your machine, so you needn’t “export” anything but
simply instantiate the configuration on the target machine.

> When I'm only using the base distro to boot, I'll switch, but for that
> I guess it would be cool to simple "export" the state of my machine to
> the new installation, with the proper 'merging' taking place. With
> merging I mean that the exported configuration will be a subset of the
> final full guixSD distro.

I’m not sure I understand what you mean by “merging” in this context.
Could you give an example of state that would be affected by a merge
like that?

--
Ricardo




Re: rolling back only a single package

2018-12-28 Thread Björn Höfling
Hi cdelia,

On Thu, 27 Dec 2018 16:52:23 -0300
cde...@dc.uba.ar wrote:

> Hi,
> 
> I upgraded guix a couple of days ago, installed some things and now I 
> found that xmobar just keeps segfaulting.
> 
> Switching to specific generation it's really cool, but in this case 
> would "uninstall" all the software that it's between the 
> update-generation and the current one.
> 
> So, there is any way to just downgrade a single package (resolving it 
> dependencies) with out doing a full switch?
> 
> I guess this it's connected to 
> https://lists.gnu.org/archive/html/help-guix/2016-08/msg00028.html
> 
> And I could also switch and then manually re install. But maybe there
> is a standard or automatic way to do it.


There is a nice blog post by Ludivic that describes some aspects of it:

https://www.gnu.org/software/guix/blog/2018/multi-dimensional-transactions-and-rollbacks-oh-my/

It looks like the inferior thing he mentioned is already ready, but I
haven't yet followed that.

Ludo, can you say something about that?

Doing it the way described in the post I can downgrade (in my case I use
youtube-dl as the package I want to downgrade, as this is in my
profile):

The trick is to work with the generations of "guix pull".

$ guix package --list-generations
Generation 122  Dec 15 2018 16:36:58
 + youtube-dl   2018.11.07  out /gnu/store/20wr2z2qnm36mwcdmmzpsvr9f4899
 - youtube-dl   2018.09.18  out /gnu/store/h7xdi93gag6r9agp5ivppignh4q0k

$ guix pull --list-generations
Generation 28   Nov 07 2018 20:38:34
  guix 91b71cf
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 91b71cfbba03ea484cc6028b3384bf4609cbcf14
[..]
Generation 29   Nov 13 2018 18:38:56
  guix d540137
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: d5401375099f6e4562b849121265bb1c3e85874f
  65 packages upgraded: certbot@0.28.0, crossguid@0.0-2.fef89a4,
[..]
wxmaxima@18.10.1, youtube-dl@2018.11.07

You see here, I did update my "guix-pull" generation on 13 November
that introduced the new youtube-dl version but did update my "guix
package" profile only on 15 December.

Now I need to use the guix from from generation 28, if I want do
downgrade my youtube-dl:


$ /var/guix/profiles/per-user/bjoern/current-guix-28-link/bin/guix
--version
guix (GNU Guix) 91b71cfbba03ea484cc6028b3384bf4609cbcf14

OK, this is really the right version, compared to the above generations
of "guix pull".

Then let's downgrade:

$ /var/guix/profiles/per-user/bjoern/current-guix-28-link/bin/guix
package -i youtube-dl
The following package will be downgraded:
   youtube-dl   2018.11.07 -> 2018.11.03
/gnu/store/vw375z5hm4vha0pvfxmadh6qcglacq9g-youtube-dl-2018.11.03

Check it out:
$ guix package --list-generations
Generation 125  Dec 28 2018 14:02:08(current)
 + youtube-dl   2018.11.03  out /gnu/store/vw375z5hm4vha0pvfxmadh6qcglac
 - youtube-dl   2018.11.07  out /gnu/store/20wr2z2qnm36mwcdmmzpsvr9f4899

~$ youtube-dl --version
2018.11.03

OK, I'm rolling back, as I don't want to downgrade:

$ guix package --roll-back
switched from generation 125 to 124

$ youtube-dl --version
2018.11.07

Is that what you are looking for?

Björn

PS: Can you help fixing the problem with xmobar?


pgpX4ZgY8OHz1.pgp
Description: OpenPGP digital signature


Re: rolling back only a single package

2018-12-28 Thread Tonton
Hello, and welcome :)

For packages where multiple versions are defined you can choose with
packagename@version e.g. guile@1.8.8 for the oldest guile on my system. A
simple way to see the versions is with the 'guix package --show=packagename'
flag. e.g. 'guix package --show=guile' will give you an entry per guile
version available.

It seems you are looking for a version of a package where the previous
definition was not kept on upgrade. Most likely because guix so far has not
kept old versions of leaf packages (i.e. packages with no dependencies);
which is why guile and python have several versions but xmobar has none.

I think the choice to not keep old definitions is to ease maintenance. But
this might be a valid discussion to have as we move towards 1.0. Maybe we
should have a policy of keeping one old version when we upgrade, as a kind of
fallback.

It occurs to me that maybe this is not a problem because of functional/purity
aspect of guix, and the package just needs a better definition? idk.

As a quick fix for xmobar I see it was updated to 0.28 in commit
ccd4fd3f2a614996bff5436cc22e4715a7eb1f31 and only two lines were changed. I
would create a file ~/my-guix-pakcages/my-xmobar.scm and put the following in
it:

-
(define-module (my-xmobar) ;; The name "my-xmobar" have to be 
   ;; the same as the filename
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (gnu packages)
  #:use-module (gnu packages wm))

(define-public my-xmobar
  (package
(inherit xmobar)
(name "xmobar")
(version "0.27")
(source (origin
 (method url-fetch)
   (uri (string-append "mirror://hackage/package/xmobar/"
   name "-" version ".tar.gz"))
  (sha256
   (base32
"0agx490q6sbmv3vfq33ys8dsrgwizj3bmha4i1pkxz5wp5q8cx3l"))
-

Then add the file to your shells $GUIX_PACKAGE_PATH like 
'export GUIX_PACKAGE_PATH=~/my-guix-pakcages/:$GUIX_PACKAGE_PATH'
in your .profile or similar. Open a new shell and run:
guix package -i xmobar@0.27

Hope that helps. :)

Tonton

On Thu, 27 Dec 2018 16:52:23 -0300
cde...@dc.uba.ar wrote:

> Hi,
> 
> I upgraded guix a couple of days ago, installed some things and now I 
> found that xmobar just keeps segfaulting.
> 
> Switching to specific generation it's really cool, but in this case 
> would "uninstall" all the software that it's between the 
> update-generation and the current one.
> 
> So, there is any way to just downgrade a single package (resolving it 
> dependencies) with out doing a full switch?
> 
> I guess this it's connected to 
> https://lists.gnu.org/archive/html/help-guix/2016-08/msg00028.html
> 
> And I could also switch and then manually re install. But maybe there is 
> a standard or automatic way to do it.
> 
> Thanks!
> 




Re: rolling back only a single package

2018-12-28 Thread Pierre Neidhardt
Hi,

I guess you could simply uninstall the offending program:

  guix package -r xmobar

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature