Re: GRUB fallback mechanism [was Re: Brain storming cool Guix features]

2019-01-14 Thread L p R n d n
Hello,

Ludovic Courtès  writes:

> Ricardo Wurmus  skribis:
>
>> swedebugia  writes:
>>
>>> Leo Famulari  skrev: (11 januari 2019 23:32:12 CET)
>
> [...]
>
Apparently GRUB has a feature that records a "fallback" system to boot
if booting fails.

Maybe when reconfiguring, Guix could set the current system as the
fallback so that it would always boot.

If we did that, we'd want to warn the user somehow... not sure how to
achieve that.

Discussion of this feature at NixOS:

https://github.com/NixOS/nixpkgs/issues/26332
>>>
>>> I don't think automatic fallback is a good idea because it unnecessarily 
>>> complicates a now well working simple part of the OS.
>>> KISS is a nice principle.
>>
>> I think exposing this GRUB feature would be good, even if not enabled by
>> default.  It does not seem very complicated and can be very useful for
>> some users.
>
> I agree.
>
>> Unfortunately, it doesn’t help us when GRUB itself is broken with an
>> upgrade, which I think is what was suggested earlier.
>
> We’ll have to assume (and ensure!) this doesn’t happen…

Personally, I never thought about a guix failure here, more about
power-outtage or anything we can't control. :D

> Ludo’.



Re: GRUB fallback mechanism [was Re: Brain storming cool Guix features]

2019-01-13 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> swedebugia  writes:
>
>> Leo Famulari  skrev: (11 januari 2019 23:32:12 CET)

[...]

>>>Apparently GRUB has a feature that records a "fallback" system to boot
>>>if booting fails.
>>>
>>>Maybe when reconfiguring, Guix could set the current system as the
>>>fallback so that it would always boot.
>>>
>>>If we did that, we'd want to warn the user somehow... not sure how to
>>>achieve that.
>>>
>>>Discussion of this feature at NixOS:
>>>
>>>https://github.com/NixOS/nixpkgs/issues/26332
>>
>> I don't think automatic fallback is a good idea because it unnecessarily 
>> complicates a now well working simple part of the OS.
>> KISS is a nice principle.
>
> I think exposing this GRUB feature would be good, even if not enabled by
> default.  It does not seem very complicated and can be very useful for
> some users.

I agree.

> Unfortunately, it doesn’t help us when GRUB itself is broken with an
> upgrade, which I think is what was suggested earlier.

We’ll have to assume (and ensure!) this doesn’t happen…

Ludo’.



Re: Brain storming cool Guix features

2019-01-13 Thread Joshua Branson
Ricardo Wurmus  writes:

> Joshua Branson  writes:
>
>> I had some cool ideas/features for things that GuixSD could potentially
>> add, and I wanted to share.  Are any of these possible?
>>
>> #+BEGIN_SRC scheme
>> (operating system
>>   (keymap  "dvorak")
>>   ...)
>> #+END_SRC
>>
>> The above would make the bootloader, console, X, and wayland all use the
>> dvorak layout.  That would be a nice feature!  I currently use "dvorak",
>> and it's slightly annoying that grub uses qwerty.  :(
>
> Same here.  Some of this might be accomplished with a system service
> that extends configuration files with the required settings.  Would you
> like to give this a try?
>

Here's what I have been able to do for this week.

td;dr
I believe I have identified conceptually how to do some of these things.

This project breaks down into four areas

Getting the layout to work with:

1) grub
2) linux's initrd
3) console
4) X/wayland's layout
5) How to do the above

1)  I was not able to get grub to generate an alternate keyboard layout.

#+BEGIN_SRC sh :results output :exports both
sudo grub-kbdcomp -o /boot/grub/dvorak.gkb dvorak
#+END_SRC

#+RESULTS:
: /home/joshua/.guix-profile/bin/grub-kbdcomp: line 76: ckbcomp: command not 
found
: ERROR: no valid keyboard layout found. Check the input.

Do we have ckbcomp installed?  How do I install that?

2) Linux's initrd

The manual mentions that there are three ways to customize your initrd.
Hopefully I'll be able to use the highlevel base-initrd procedure.

Furthermore, if you need lower-level customization, the ‘initrd’
 field of an ‘operating-system’ declaration allows you to specify which
 initrd you would like to use.  The ‘(gnu system linux-initrd)’ module
 provides three ways to build an initrd: the high-level ‘base-initrd’
 procedure and the low-level ‘raw-initrd’ and ‘expression->initrd’
 procedures.

3) console
   This shouldn't be all that hard to do.  We just have to add a
   console-keymap-service.

4) X/Wayland's layout shouldn't be all that hard to do too.  X is just
a simple xorg-start-command tweak.  I'm not certain how to do the same
for wayland yet.


5) Now, how do I go about doing the above?  I thought about modifying
%base-services and %desktop services, but some users won't use those
variables.  So I am going to have to do some change at a deeper level.
I believe that I found the reconfigure module in the guix source code,
and I see the variable called "operating-system-user-services".  My
intent is to modify this variable, and that should be how a good-old
reconfigure will change your layout.

Thanks,

--
Joshua Branson
Sent from Emacs and Gnus



Re: GRUB fallback mechanism [was Re: Brain storming cool Guix features]

2019-01-12 Thread Ricardo Wurmus


swedebugia  writes:

> Leo Famulari  skrev: (11 januari 2019 23:32:12 CET)
>>On Mon, Jan 07, 2019 at 05:48:39PM +0100, L p R n d n wrote:
>>> - Currently, I think the only way for a GuixSD installation to break
>>is
>>>   if something goes wrong with the bootloader. Might be nice to have
>>a
>>>   tool (in the install image I suppose) to recover the bootloader.
>>>   Maybe 'guix system init' can deal with that king of cases for now,
>>I
>>>   don't know, but a dedicated command might be able to use the
>>original
>>>   store, restore previous generations etc.
>>
>>Apparently GRUB has a feature that records a "fallback" system to boot
>>if booting fails.
>>
>>Maybe when reconfiguring, Guix could set the current system as the
>>fallback so that it would always boot.
>>
>>If we did that, we'd want to warn the user somehow... not sure how to
>>achieve that.
>>
>>Discussion of this feature at NixOS:
>>
>>https://github.com/NixOS/nixpkgs/issues/26332
>
> I don't think automatic fallback is a good idea because it unnecessarily 
> complicates a now well working simple part of the OS.
> KISS is a nice principle.

I think exposing this GRUB feature would be good, even if not enabled by
default.  It does not seem very complicated and can be very useful for
some users.

Unfortunately, it doesn’t help us when GRUB itself is broken with an
upgrade, which I think is what was suggested earlier.

--
Ricardo




Re: GRUB fallback mechanism [was Re: Brain storming cool Guix features]

2019-01-12 Thread swedebugia
Leo Famulari  skrev: (11 januari 2019 23:32:12 CET)
>On Mon, Jan 07, 2019 at 05:48:39PM +0100, L p R n d n wrote:
>> - Currently, I think the only way for a GuixSD installation to break
>is
>>   if something goes wrong with the bootloader. Might be nice to have
>a
>>   tool (in the install image I suppose) to recover the bootloader.
>>   Maybe 'guix system init' can deal with that king of cases for now,
>I
>>   don't know, but a dedicated command might be able to use the
>original
>>   store, restore previous generations etc.
>
>Apparently GRUB has a feature that records a "fallback" system to boot
>if booting fails.
>
>Maybe when reconfiguring, Guix could set the current system as the
>fallback so that it would always boot.
>
>If we did that, we'd want to warn the user somehow... not sure how to
>achieve that.
>
>Discussion of this feature at NixOS:
>
>https://github.com/NixOS/nixpkgs/issues/26332

I don't think automatic fallback is a good idea because it unnecessarily 
complicates a now well working simple part of the OS. 
KISS is a nice principle. 
-- 
Sent from my p≡p for Android.


pEpkey.asc
Description: application/pgp-keys


GRUB fallback mechanism [was Re: Brain storming cool Guix features]

2019-01-11 Thread Leo Famulari
On Mon, Jan 07, 2019 at 05:48:39PM +0100, L p R n d n wrote:
> - Currently, I think the only way for a GuixSD installation to break is
>   if something goes wrong with the bootloader. Might be nice to have a
>   tool (in the install image I suppose) to recover the bootloader.
>   Maybe 'guix system init' can deal with that king of cases for now, I
>   don't know, but a dedicated command might be able to use the original
>   store, restore previous generations etc.

Apparently GRUB has a feature that records a "fallback" system to boot
if booting fails.

Maybe when reconfiguring, Guix could set the current system as the
fallback so that it would always boot.

If we did that, we'd want to warn the user somehow... not sure how to
achieve that.

Discussion of this feature at NixOS:

https://github.com/NixOS/nixpkgs/issues/26332


signature.asc
Description: PGP signature


Re: Brain storming cool Guix features

2019-01-07 Thread Joshua Branson
L  p R n  d n writes:
>>
>>
>> The above would set a default font for the user joshua.
>>
>>
>> How about a hook that stores the user's profile of packages in a
>> manifest file after every package transaction (upgrade or downgrade)?
>>
>> #+BEGIN_SRC
>> (user-account
>> (name "joshua")
>> (updates-in-manifest #t)
>> (manifest-file "/etc/manifest.scm"))
>> #+END_SRC
>
> The ability to deal with user profiles in the configure file would be
> awesome. Is it already possible to define a "default" manifest for a
> user? If not, could be cool too.

There is not default method to do this, but it is possible.  You'd just
need to write some custom code to do it.

>
>>
>> How about automatic updates?  Since a guixSD user can always downgrade
>> to the previous version, it would be nice if it would automatically
>> update my user profile, root profile and reconfigure say once a week.
>>
>> #+BEGIN_SRC scheme
>> (operating system
>>   (auto-upgrade #t)
>>   (auto-upgrade-interval 'once-a-week)
>>   ...)
>> #+END_SRC
>
> As said by Ricardo, currently a cron job might just be enough. In the
> long term, a tool to manage updating (pause, schedule, configure stuff)
> could be useful.
>
>> --
>> Joshua Branson
>> Sent from Emacs and Gnus
>
> If I can add, I thought about something.
>
> - Currently, I think the only way for a GuixSD installation to break is
>   if something goes wrong with the bootloader. Might be nice to have a
>   tool (in the install image I suppose) to recover the bootloader.
>   Maybe 'guix system init' can deal with that king of cases for now, I
>   don't know, but a dedicated command might be able to use the original
>   store, restore previous generations etc.

That's a great idea.  I think guix has a command to generate a boot-able
image.  You should be able to add "grub" to the commands that are
available to you.

Then it's just a grub-install command.  The arch wiki has good
documentation on this.  :)

>
> Bye,
>
> Lprndn
>

--
Joshua Branson
Sent from Emacs and Gnus



Re: Brain storming cool Guix features

2019-01-07 Thread L p R n d n


Hellohello,

Joshua Branson  writes:

> I had some cool ideas/features for things that GuixSD could potentially
> add, and I wanted to share.  Are any of these possible?
>
> #+BEGIN_SRC scheme
> (operating system
>   (keymap  "dvorak")
>   ...)
> #+END_SRC
>
>
> The above would make the bootloader, console, X, and wayland all use the
> dvorak layout.  That would be a nice feature!  I currently use "dvorak",
> and it's slightly annoying that grub uses qwerty.  :(
>
> #+BEGIN_SRC
> (user-account
>(name "joshua")
>(default-font "font-hack"))
> #+END_SRC
>
>
> The above would set a default font for the user joshua.
>
>
> How about a hook that stores the user's profile of packages in a
> manifest file after every package transaction (upgrade or downgrade)?
>
> #+BEGIN_SRC
> (user-account
> (name "joshua")
> (updates-in-manifest #t)
> (manifest-file "/etc/manifest.scm"))
> #+END_SRC

The ability to deal with user profiles in the configure file would be
awesome. Is it already possible to define a "default" manifest for a
user? If not, could be cool too.  

>
> How about automatic updates?  Since a guixSD user can always downgrade
> to the previous version, it would be nice if it would automatically
> update my user profile, root profile and reconfigure say once a week.
>
> #+BEGIN_SRC scheme
> (operating system
>   (auto-upgrade #t)
>   (auto-upgrade-interval 'once-a-week)
>   ...)
> #+END_SRC

As said by Ricardo, currently a cron job might just be enough. In the
long term, a tool to manage updating (pause, schedule, configure stuff)
could be useful.

> --
> Joshua Branson
> Sent from Emacs and Gnus


If I can add, I thought about something.

- Currently, I think the only way for a GuixSD installation to break is
  if something goes wrong with the bootloader. Might be nice to have a
  tool (in the install image I suppose) to recover the bootloader.
  Maybe 'guix system init' can deal with that king of cases for now, I
  don't know, but a dedicated command might be able to use the original
  store, restore previous generations etc.

Bye,

Lprndn



Re: Brain storming cool Guix features

2019-01-06 Thread Amirouche Boubekki
Le dim. 6 janv. 2019 à 17:33, swedebugia  a écrit :

> Amirouche Boubekki  skrev: (6 januari 2019
> 14:44:30 CET)
> >Le ven. 4 janv. 2019 à 18:14,  a écrit :
> >
> >
> >> - Guile and Scheme for Beginners book.
> >>
> >
> >Regarding this topic, I just made a mini game to teach scheme, there
> >very
> >few exercices, let me know what you think
> >
> >http://scheme-lang.com/cons/
>
> I like it!
>

Thanks a lot! I forgot to point out that the code is available at your own
risk at https://github.com/amirouche/scheme-lang/

A tentative explanation of how it works is over the moutain at
https://groups.google.com/forum/#!topic/chibi-scheme/UW11XvoAF1c


> Maybe we could make a guix variant. Maybe enable selection of topics in
> the beginning like: config, packaging, derivations...
>

With that tool at hand, we can imagine many things. My primary thoughts was
about learning scheme hence guile (even if it's a variant of scheme, a lot
of concepts are shared between the two). But we could use it to provide
questions with multiple answers to learn guix specifically.


Re: Brain storming cool Guix features

2019-01-06 Thread swedebugia
Amirouche Boubekki  skrev: (6 januari 2019 
14:44:30 CET)
>Le ven. 4 janv. 2019 à 18:14,  a écrit :
>
>
>> - Guile and Scheme for Beginners book.
>>
>
>Regarding this topic, I just made a mini game to teach scheme, there
>very
>few exercices, let me know what you think
>
>http://scheme-lang.com/cons/

I like it! 

Maybe we could make a guix variant. Maybe enable selection of topics in the 
beginning like: config, packaging, derivations...
-- 
Sent from my p≡p for Android.


pEpkey.asc
Description: application/pgp-keys


Re: Brain storming cool Guix features

2019-01-06 Thread Amirouche Boubekki
Le ven. 4 janv. 2019 à 18:14,  a écrit :


> - Guile and Scheme for Beginners book.
>

Regarding this topic, I just made a mini game to teach scheme, there very
few exercices, let me know what you think

http://scheme-lang.com/cons/


Re: Brain storming cool Guix features

2019-01-05 Thread Ricardo Wurmus


Hi Joshua,

> Ricardo Wurmus  writes:
>
>> Joshua Branson  writes:
>>
>>> I had some cool ideas/features for things that GuixSD could potentially
>>> add, and I wanted to share.  Are any of these possible?
>>>
>>> #+BEGIN_SRC scheme
>>> (operating system
>>>   (keymap  "dvorak")
>>>   ...)
>>> #+END_SRC
>>>
>>> The above would make the bootloader, console, X, and wayland all use the
>>> dvorak layout.  That would be a nice feature!  I currently use "dvorak",
>>> and it's slightly annoying that grub uses qwerty.  :(
>>
>> Same here.  Some of this might be accomplished with a system service
>> that extends configuration files with the required settings.  Would you
>> like to give this a try?
>
> Yes I would!  I will probably need some mentoring to figure it all out,
> but I will take a go at it.  I think I know how to go about trying it.
> I'll get back to you next week, when I'll probably need some more
> direction.

Excellent!  I recommend looking at the manual section “6.2.15.1 Service
Composition”.  We would like to have a service that extends other
existing services — in some cases we want an extension of the
etc-service-type, which adds files to /etc.  In other cases we may want
to extend the configuration of some X11 service, which is trickier.

Before you try to write any code at all, it would make sense to figure
out what exactly we want to happen.  Currently, the way to configure X11
is a bit awkward: I need to do something like this to override X11
settings:

--8<---cut here---start->8---
(slim-service-type
 config => (slim-configuration
(inherit config)
(startx (xorg-start-command
 #:configuration-file
 (xorg-configuration-file
  #:extra-config
  (list dvorak-evdev))
--8<---cut here---end--->8---

But what should the service do if we aren’t using slim-service-type?  It
seems to me that maybe slim-service-type should extend some new
x11-service-type that has its own configuration, instead of having the
X11 configuration be a side effect of specifying the “startx” field of
the slim-configuration.

Feel free to come up with a better way and discuss it here on the list
rather than trying to squeeze the desired behaviour into the current
implementation.

--
Ricardo




Re: Brain storming cool Guix features

2019-01-05 Thread Joshua Branson
Ricardo Wurmus  writes:

> Joshua Branson  writes:
>
>> I had some cool ideas/features for things that GuixSD could potentially
>> add, and I wanted to share.  Are any of these possible?
>>
>> #+BEGIN_SRC scheme
>> (operating system
>>   (keymap  "dvorak")
>>   ...)
>> #+END_SRC
>>
>> The above would make the bootloader, console, X, and wayland all use the
>> dvorak layout.  That would be a nice feature!  I currently use "dvorak",
>> and it's slightly annoying that grub uses qwerty.  :(
>
> Same here.  Some of this might be accomplished with a system service
> that extends configuration files with the required settings.  Would you
> like to give this a try?

Yes I would!  I will probably need some mentoring to figure it all out,
but I will take a go at it.  I think I know how to go about trying it.
I'll get back to you next week, when I'll probably need some more
direction. 

>
>> How about automatic updates?  Since a guixSD user can always downgrade
>> to the previous version, it would be nice if it would automatically
>> update my user profile, root profile and reconfigure say once a week.
>>
>> #+BEGIN_SRC scheme
>> (operating system
>>   (auto-upgrade #t)
>>   (auto-upgrade-interval 'once-a-week)
>>   ...)
>> #+END_SRC
>
> Cron jobs can be used here via the mcron service.

--
Joshua Branson
Sent from Emacs and Gnus



Re: Brain storming cool Guix features

2019-01-04 Thread znavko
Hello! As topic is started, I suggest this to a roadmap 
http://git.savannah.gnu.org/cgit/guix.git/tree/ROADMAP 
 :

znavko`s  roadmap suggestions:
- total guix architecture guide (not only descriptions of cases ‘environment’, 
‘system’, ‘package’ and its options) with pictures,
- interface for searching for substitute servers or a list of available servers
- searching interface for packages substitution (server url, system type, 
package version), how you can find server where package you need is compiled
- feature for getting source config.scm used in `guix system configure` (for 
beginners when deleted or modified to unworkable)
- count estimative compilation time for every package in different system 
configurations and display it  for user system configuration when run `guix 
package -u` or `guix package -i name`
- promotional video with infographics why to choose Guix and GuixSD

Also this:
- wiki with operating system configurations (starting from a subject, but not 
from existing options): system packages, services configurations with examples 
and full list of variables even where to paste it,
- Guile and Scheme for Beginners book.

Jan 4, 2019, 12:11 PM by jbra...@dismail.de:

>
> I had some cool ideas/features for things that GuixSD could potentially
> add, and I wanted to share.  Are any of these possible?
>
> #+BEGIN_SRC scheme
> (operating system
>  (keymap  "dvorak")
>  ...)
> #+END_SRC
>
> The above would make the bootloader, console, X, and wayland all use the
> dvorak layout.  That would be a nice feature!  I currently use "dvorak",
> and it's slightly annoying that grub uses qwerty.  :(
>
> #+BEGIN_SRC
> (user-account
>  (name "joshua")
>  (default-font "font-hack"))
> #+END_SRC
>
> The above would set a default font for the user joshua.
>
>
> How about a hook that stores the user's profile of packages in a
> manifest file after every package transaction (upgrade or downgrade)?
>
> #+BEGIN_SRC
> (user-account
>  (name "joshua")
>  (updates-in-manifest #t)
>  (manifest-file "/etc/manifest.scm"))
> #+END_SRC
>
> How about automatic updates?  Since a guixSD user can always downgrade
> to the previous version, it would be nice if it would automatically
> update my user profile, root profile and reconfigure say once a week.
>
> #+BEGIN_SRC scheme
> (operating system
>  (auto-upgrade #t)
>  (auto-upgrade-interval 'once-a-week)
>  ...)
> #+END_SRC
>
> --
> Joshua Branson
> Sent from Emacs and Gnus
>



Re: Brain storming cool Guix features

2019-01-04 Thread Ricardo Wurmus


Joshua Branson  writes:

> I had some cool ideas/features for things that GuixSD could potentially
> add, and I wanted to share.  Are any of these possible?
>
> #+BEGIN_SRC scheme
> (operating system
>   (keymap  "dvorak")
>   ...)
> #+END_SRC
>
> The above would make the bootloader, console, X, and wayland all use the
> dvorak layout.  That would be a nice feature!  I currently use "dvorak",
> and it's slightly annoying that grub uses qwerty.  :(

Same here.  Some of this might be accomplished with a system service
that extends configuration files with the required settings.  Would you
like to give this a try?

> How about automatic updates?  Since a guixSD user can always downgrade
> to the previous version, it would be nice if it would automatically
> update my user profile, root profile and reconfigure say once a week.
>
> #+BEGIN_SRC scheme
> (operating system
>   (auto-upgrade #t)
>   (auto-upgrade-interval 'once-a-week)
>   ...)
> #+END_SRC

Cron jobs can be used here via the mcron service.

-- 
Ricardo




Re: Brain storming cool Guix features

2019-01-04 Thread John Soo
Yes, good ideas! I’m curious if per-user packages could be declared in the 
system configuration. I think nixOS has that feature now and I’m a little 
jealous...

> On Jan 4, 2019, at 8:10 AM, Pierre Neidhardt  wrote:
> 
> Very nice ideas, in particular the manifest-file option!
> 
> Note that something like ~/.config/guix/manifest.scm would probably be a 
> better
> fit for user-profile manifests.
> 
> -- 
> Pierre Neidhardt
> https://ambrevar.xyz/



Re: Brain storming cool Guix features

2019-01-04 Thread Pierre Neidhardt
Very nice ideas, in particular the manifest-file option!

Note that something like ~/.config/guix/manifest.scm would probably be a better
fit for user-profile manifests.

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


signature.asc
Description: PGP signature