unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Re: Guix does not understand config.scm
  2018-04-23 19:22 Guix does not understand config.scm Jone
@ 2018-04-23 18:30 ` Thomas Sigurdsen
  2018-04-23 18:40 ` Leo Famulari
  2018-04-23 19:10 ` Alex Kost
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Sigurdsen @ 2018-04-23 18:30 UTC (permalink / raw)
  To: Jone; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 4682 bytes --]

Hi,

I've figured some things out here, hope you can use it. For the future, I
find it much easier to test and help if you attach the file or post it to a
pastebin (see the wgetpaste program to make that easier). Of course you
remove whatever is of a security or privacy concern for you.

I don't know what the 2 servces I've commented out where supposed to do. I
think you should look up defining services in the docs, or maybe you wanted
something else entirely.

> Questions:
> 1. How to debug config.scm, line by line? Is that possible?

Debugging line by line is not simple, or something I do. But I use strace. If
I get unintelligible errors from guix I usually do:
strace -o /tmp/strace.out -T -s 2000  -f guix-command
Then use less or grep or some other tool to inspect the output
in /tmp/strace.out. Things to look for are error, warning and anything it
says about files not part of guix, i.e. files in your home directory (not
including ~/.config/guix/latest and similar) or wherever you keep your guix
personal files (configs modules and whatnot).

I also look at other peoples configurations. There are quite a few online in
github and notabug and similar that will give you a good idea of how to do
things. Mine is here: https://notabug.org/thomassgn/guixsd-configuration/

And last but not least, have a git clone of the guix sources from savannah
and check the tests (gnu/tests/) and examples (gnu/system/examples).

You can also read the source, but by this time I've gone to IRC or something.

> 2. Where can I find the full list of modules for "use-modules"?

It will say in the info documentation. Or look through the sources.

Also, run 'visudo --check --file=/etc/sudoers' when you change it, cause
last I bodged it, guix had no idea the sudoers file was not working. One of
the few bad accidents I've had with guix where guix couldn't fix guix
because the problem was not guix.

And you might want to have sudoers somewhere else so you can build your
system without root. You still need root to "install" (i.e. reconfigure or
similar) your system.

Hope this helps.

On Mon, 23 Apr 2018 19:22:43 +0000
Jone <yeger9@gmail.com> wrote:

> This is my new (and wrong) config:
> 
>      1	(use-modules
>      2	 (srfi srfi-1)
>      3	 (guix)
>      4	 (gnu))
>      5	(use-service-modules networking desktop admin mcron)
>      6	(use-package-modules base bootloaders ssh)
>      7	(operating-system
>      8	  (host-name "guix")
>      9	  (timezone "Europe/Moscow")
>     10	  (locale "ru_RU.UTF-8")
>     11	  (locale-definitions
>     12	   '((locale-definition (source "ru_RU") (name "ru_RU.utf8"))
>     13	  	 (locale-definition (source "en_US") (name
> "en_US.utf8")))) 14	  (bootloader (bootloader-configuration
>     ....................................................................
>     24	  (initrd-modules (cons* "sata_nv"		;; Nvidia
> nForce 25	                         "pata_acpi" %base-initrd-modules))
>     26	  (file-systems (cons*
>     ....................................................................
>     47	                 %base-file-systems))
>     48	  (swap-devices
> '("/dev/disk/by-uuid/0602935f-4ed2-4805-9ec9-e0c06238abf5")) 49
> (users (cons (user-account 50	                (name "jone")
>     51	                (comment "Jone")
>     52	                (group "users")
>     53	                (supplementary-groups '("wheel" "netdev"
> "audio" "video")) 54	                (home-directory "/home/jone"))
>     55	               %base-user-accounts))
>     56	  (sudoers-file (local-file (config-file "/etc/sudoers")))
>     57	  (packages
>     58	   (let ((trash (specifications->packages
>     59					 "zile" "wireless-tools")))
>     ....................................................................
>     67						 %base-packages))))
>     68	  (services (cons*
>     69				 (extra-special-file "/usr/bin/env"
>     70
> (file-append coreutils "/bin/env")) 71
> (extra-special-file "/bin/sh"
> 72
> (file-append bash "/bin/bash")) 73
> (xfce-desktop-service) 74				 (service
> mcron-service-type) 75				 (service
> rottlog-service-type) 76
> %desktop-services)) 77	  )
> 
> Next I run 'guix system reconfigure new.scm':
> 
>    new.scm:49:9: config-file: unbound variable
>    hint: Did you forget a `use-modules' form?
> 
> Ok, for test comment section "(users (cons .." and line "(sudoers-file ..",
> but next again:
> 
>    new.scm:26:16: specifications->packages: unbound variable
>    hint: Did you forget a `use-modules' form?
> 
> Questions:
> 1. How to debug config.scm, line by line? Is that possible?
> 2. Where can I find the full list of modules for "use-modules"?
> 3. And how to fix this config?
> 


[-- Attachment #2: jone.scm --]
[-- Type: text/x-scheme, Size: 1768 bytes --]

(use-modules (srfi srfi-1)
             (guix)
             (gnu system locale)
             (gnu))

(use-service-modules networking desktop admin mcron)

(use-package-modules base bootloaders ssh bash zile linux)

(operating-system
 (host-name "guix")
 (timezone "Europe/Moscow")
 (locale "ru_RU.UTF-8")

 (locale-definitions
  (list (locale-definition (source "ru_RU") (name "ru_RU.utf8"))
        (locale-definition (source "en_US") (name "en_US.utf8"))))

 
  (bootloader (bootloader-configuration
               (bootloader grub-bootloader)
               (target "/dev/sda")
               (terminal-outputs '(console))))

  (initrd-modules (cons* "sata_nv"		;; Nvidia nForce
                         "pata_acpi" %base-initrd-modules))

  (file-systems (cons*
                 (file-system
                  (device "mr")
                  (title 'label)
                  (mount-point "/")
                  (type "ext4"))
                 %base-file-systems))
  (swap-devices '())

 (users (cons (user-account
                (name "jone")
                (comment "Jone")
                (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/jone"))
              %base-user-accounts))

 (sudoers-file (local-file "/etc/sudoers"))
 (packages
  (cons*
   zile wireless-tools
    %base-packages))

(services (cons*
;           (extra-special-file "/usr/bin/env"
;                               (file-append coreutils "/bin/env"))
;           (extra-special-file "/bin/sh"
;                               (file-append bash "/bin/bash"))
           (xfce-desktop-service)
           (service mcron-service-type)
           (service rottlog-service-type)
            %desktop-services)))

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Guix does not understand config.scm
  2018-04-23 19:22 Guix does not understand config.scm Jone
  2018-04-23 18:30 ` Thomas Sigurdsen
@ 2018-04-23 18:40 ` Leo Famulari
  2018-04-23 19:10 ` Alex Kost
  2 siblings, 0 replies; 5+ messages in thread
From: Leo Famulari @ 2018-04-23 18:40 UTC (permalink / raw)
  To: Jone; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2799 bytes --]

On Mon, Apr 23, 2018 at 07:22:43PM +0000, Jone wrote:
> This is my new (and wrong) config:
> 
>      1	(use-modules
>      2	 (srfi srfi-1)
>      3	 (guix)
>      4	 (gnu))
>      5	(use-service-modules networking desktop admin mcron)
>      6	(use-package-modules base bootloaders ssh)
>      7	(operating-system
>      8	  (host-name "guix")
>      9	  (timezone "Europe/Moscow")
>     10	  (locale "ru_RU.UTF-8")
>     11	  (locale-definitions
>     12	   '((locale-definition (source "ru_RU") (name "ru_RU.utf8"))
>     13	  	 (locale-definition (source "en_US") (name "en_US.utf8"))))
>     14	  (bootloader (bootloader-configuration
>     ....................................................................
>     24	  (initrd-modules (cons* "sata_nv"		;; Nvidia nForce
>     25	                         "pata_acpi" %base-initrd-modules))
>     26	  (file-systems (cons*
>     ....................................................................
>     47	                 %base-file-systems))
>     48	  (swap-devices '("/dev/disk/by-uuid/0602935f-4ed2-4805-9ec9-e0c06238abf5"))
>     49	  (users (cons (user-account
>     50	                (name "jone")
>     51	                (comment "Jone")
>     52	                (group "users")
>     53	                (supplementary-groups '("wheel" "netdev" "audio" "video"))
>     54	                (home-directory "/home/jone"))
>     55	               %base-user-accounts))
>     56	  (sudoers-file (local-file (config-file "/etc/sudoers")))
>     57	  (packages
>     58	   (let ((trash (specifications->packages
>     59					 "zile" "wireless-tools")))
>     ....................................................................
>     67						 %base-packages))))
>     68	  (services (cons*
>     69				 (extra-special-file "/usr/bin/env"
>     70									 (file-append coreutils "/bin/env"))
>     71				 (extra-special-file "/bin/sh"
>     72									 (file-append bash "/bin/bash"))
>     73				 (xfce-desktop-service)
>     74				 (service mcron-service-type)
>     75				 (service rottlog-service-type)
>     76				 %desktop-services))
>     77	  )
> 
> Next I run 'guix system reconfigure new.scm':
> 
>    new.scm:49:9: config-file: unbound variable
>    hint: Did you forget a `use-modules' form?
> 
> Ok, for test comment section "(users (cons .." and line "(sudoers-file ..",
> but next again:
> 
>    new.scm:26:16: specifications->packages: unbound variable
>    hint: Did you forget a `use-modules' form?
> 
> Questions:
> 1. How to debug config.scm, line by line? Is that possible?
> 2. Where can I find the full list of modules for "use-modules"?
> 3. And how to fix this config?

Can you include your config.scm as an attachment so other people can
test it?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Guix does not understand config.scm
  2018-04-23 19:22 Guix does not understand config.scm Jone
  2018-04-23 18:30 ` Thomas Sigurdsen
  2018-04-23 18:40 ` Leo Famulari
@ 2018-04-23 19:10 ` Alex Kost
  2018-04-24 16:50   ` Jone
  2 siblings, 1 reply; 5+ messages in thread
From: Alex Kost @ 2018-04-23 19:10 UTC (permalink / raw)
  To: Jone; +Cc: help-guix

Jone (2018-04-23 19:22 +0000) wrote:

> This is my new (and wrong) config:
[...]
>     56	  (sudoers-file (local-file (config-file "/etc/sudoers")))

He-he, I recognize this :-)
I guess you took this line from my os config, anyway...

> Next I run 'guix system reconfigure new.scm':
>
>    new.scm:49:9: config-file: unbound variable
>    hint: Did you forget a `use-modules' form?

... this means that you did not define 'config-file'.

'config-file' is a simple function I use to return file names from my
"~/config" directory, i.e.:

  (config-file "/etc/sudoers")  returns  "/home/<me>/config/etc/sudoers"

So if you want to specify sudoers file, you can just use:

  (sudoers-file (local-file "/path/to/your/sudoers-file"))

-- 
Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Guix does not understand config.scm
@ 2018-04-23 19:22 Jone
  2018-04-23 18:30 ` Thomas Sigurdsen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jone @ 2018-04-23 19:22 UTC (permalink / raw)
  To: help-guix

This is my new (and wrong) config:

     1	(use-modules
     2	 (srfi srfi-1)
     3	 (guix)
     4	 (gnu))
     5	(use-service-modules networking desktop admin mcron)
     6	(use-package-modules base bootloaders ssh)
     7	(operating-system
     8	  (host-name "guix")
     9	  (timezone "Europe/Moscow")
    10	  (locale "ru_RU.UTF-8")
    11	  (locale-definitions
    12	   '((locale-definition (source "ru_RU") (name "ru_RU.utf8"))
    13	  	 (locale-definition (source "en_US") (name "en_US.utf8"))))
    14	  (bootloader (bootloader-configuration
    ....................................................................
    24	  (initrd-modules (cons* "sata_nv"		;; Nvidia nForce
    25	                         "pata_acpi" %base-initrd-modules))
    26	  (file-systems (cons*
    ....................................................................
    47	                 %base-file-systems))
    48	  (swap-devices '("/dev/disk/by-uuid/0602935f-4ed2-4805-9ec9-e0c06238abf5"))
    49	  (users (cons (user-account
    50	                (name "jone")
    51	                (comment "Jone")
    52	                (group "users")
    53	                (supplementary-groups '("wheel" "netdev" "audio" "video"))
    54	                (home-directory "/home/jone"))
    55	               %base-user-accounts))
    56	  (sudoers-file (local-file (config-file "/etc/sudoers")))
    57	  (packages
    58	   (let ((trash (specifications->packages
    59					 "zile" "wireless-tools")))
    ....................................................................
    67						 %base-packages))))
    68	  (services (cons*
    69				 (extra-special-file "/usr/bin/env"
    70									 (file-append coreutils "/bin/env"))
    71				 (extra-special-file "/bin/sh"
    72									 (file-append bash "/bin/bash"))
    73				 (xfce-desktop-service)
    74				 (service mcron-service-type)
    75				 (service rottlog-service-type)
    76				 %desktop-services))
    77	  )

Next I run 'guix system reconfigure new.scm':

   new.scm:49:9: config-file: unbound variable
   hint: Did you forget a `use-modules' form?

Ok, for test comment section "(users (cons .." and line "(sudoers-file ..",
but next again:

   new.scm:26:16: specifications->packages: unbound variable
   hint: Did you forget a `use-modules' form?

Questions:
1. How to debug config.scm, line by line? Is that possible?
2. Where can I find the full list of modules for "use-modules"?
3. And how to fix this config?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Guix does not understand config.scm
  2018-04-23 19:10 ` Alex Kost
@ 2018-04-24 16:50   ` Jone
  0 siblings, 0 replies; 5+ messages in thread
From: Jone @ 2018-04-24 16:50 UTC (permalink / raw)
  To: Alex Kost; +Cc: help-guix

> He-he, I recognize this :-)

Copy-paste method! ;) Guix manual.. is too academic. And does not
contain examples.
(I'll get back to that later).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-24 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 19:22 Guix does not understand config.scm Jone
2018-04-23 18:30 ` Thomas Sigurdsen
2018-04-23 18:40 ` Leo Famulari
2018-04-23 19:10 ` Alex Kost
2018-04-24 16:50   ` Jone

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).