all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* G-Expressions manual. change user shell in guix config.scm
@ 2019-05-03 15:36 znavko
  2019-05-04  3:11 ` rendaw
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: znavko @ 2019-05-03 15:36 UTC (permalink / raw)
  To: help-guix

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

I want to try to use G-expressions to change 'mom' user shell to dash.
I have this error:

# guix system reconfigure config-znavko.scm
...
building /gnu/store/zhmd8fr5v86wnaf6apcz4281c008fjv5-shepherd-user-homes.scm.drv...
building /gnu/store/6wnbkfdqy3qmbcjz00d1w5p8mw1rkyaa-shells.drv...
/builder for `/gnu/store/6wnbkfdqy3qmbcjz00d1w5p8mw1rkyaa-shells.drv' failed with exit code 1
build of /gnu/store/6wnbkfdqy3qmbcjz00d1w5p8mw1rkyaa-shells.drv failed
View build log at '/var/log/guix/drvs/6w/nbkfdqy3qmbcjz00d1w5p8mw1rkyaa-shells.drv.bz2'.
cannot build derivation `/gnu/store/36ah9x5q8nj6y01fs32brcndmkgyvqmv-etc.drv': 1 dependencies couldn't be built
building /gnu/store/kvdsb795wn1ic8p9kcdsbkd9vw5v4dm2-shepherd.conf.drv...
cannot build derivation `/gnu/store/cmfly4pn3hs2y38km0l3yn3phkxy84xj-system.drv': 1 dependencies couldn't be built
guix system: error: build of `/gnu/store/cmfly4pn3hs2y38km0l3yn3phkxy84xj-system.drv' failed

# tail -n1 /var/log/guix/drvs/6w/nbkfdqy3qmbcjz00d1w5p8mw1rkyaa-shells.drv
ERROR: Wrong type to apply: "/gnu/store/bqmib4vf9mr8dkqx4dqpcqrnb93giwci-dash-0.5.10.2"
it is here:
(user-account (name "mom") (group "users")
(supplementary-groups '("wheel" "netdev" "audio" "video"))
(home-directory "/home/mom")
(shell #~(#$dash)))
I read Guix Refernce Manual 'G-Expressions' section, but there types described quite a little: Scheme Syntax: #~exp  Scheme Syntax: (gexp exp)   

	Return a G-expression containing exp. exp may contain one or more of the following forms:  #$obj (ungexp obj)  

	Introduce a reference to obj. obj may have one of the supported types, for example a package or a derivation, in which case the ungexp form is replaced by its output file name—e.g., "/gnu/store/…-coreutils-8.22. 

	If obj is a list, it is traversed and references to supported objects are substituted similarly. 

	If obj is another gexp, its contents are inserted and its dependencies are added to those of the containing gexp. 

	If obj is another kind of object, it is inserted as is.     
My wrong config is attached.

But I've found on github workable example https://github.com/meiyopeng/guix-config/blob/master/meiyo/systems/default.scm

And rewrite config with file-append Scheme procedure. This works:

 (user-account (name "mom") (group "users")
 (supplementary-groups '("wheel" "netdev" "audio" "video"))
 (home-directory "/home/mom")
 (shell (file-append dash "/bin/dash")))

But I am confused, cause I do not know why config works without #~ and #~ but only file-append function? Is it still G-Expression (shell (file-append dash "/bin/dash"))?

[-- Attachment #2: config-znavko.scm --]
[-- Type: application/octet-stream, Size: 2817 bytes --]

;-*- mode: Scheme; -*-
;;this is znavko's cute config

(use-modules (gnu) (gnu system nss)
	     (gnu system locale) ;;for locale-definition
	     (gnu services desktop)
	     (srfi srfi-1)	       ;;for remove function
	     (gnu services networking) ;;for remove ntp
	     (gnu services avahi)      ;;for remove avahi
	     (gnu services xorg)
	     (gnu packages admin) ;;for wpa_supplicant
	     (gnu packages shells)
	     (guix gexp)
	     )

(use-service-modules desktop)
(use-package-modules certs gnome)

(operating-system (host-name "antelope") (timezone "Europe/Moscow") (locale "en_US.utf8")
		  (bootloader (bootloader-configuration (bootloader grub-bootloader) (target "/dev/sda")))
		  (file-systems (cons (file-system (device "/dev/sda1") (mount-point "/") (type "ext4")) %base-file-systems))
		  (swap-devices '("/dev/sda2"))

		  (users (cons* (user-account (name "bob") (group "users")
					      (supplementary-groups '("wheel" "netdev" "audio" "video"))
					      (home-directory "/home/bob"))
				(user-account (name "mom") (group "users")
					      (supplementary-groups '("wheel" "netdev" "audio" "video"))
					      (home-directory "/home/mom")
					      (shell #~(#$dash)))
				%base-user-accounts))

		  ;; This is where we specify system-wide packages.
		  (packages (cons* nss-certs ;for HTTPS access
				   gvfs	     ;for user mounts
				   wpa-supplicant
				   zsh
				   %base-packages))

		  (services (cons* 
			     (service xfce-desktop-service-type)
			     (service dhcp-client-service-type)
			     (service slim-service-type
				      (slim-configuration
					(xorg-configuration
					 (xorg-configuration
					  (extra-config  
					   '("Section \"InputClass\"
Identifier \"touchpad\"
Driver \"libinput\"
MatchIsTouchpad \"on\"
Option \"Tapping\" \"on\"
EndSection")
					   ))))
				      )

			     (modify-services      
			      (remove (lambda (service)
					(member (service-kind service)
						(list ntp-service-type avahi-service-type 
						      bluetooth-service network-manager-service-type
						      gdm-service-type)))
				      %desktop-services) ;end of remove lambda services

			      (wpa-supplicant-service-type config =>
							   (wpa-supplicant-configuration
							    (interface "wlp2s0")
							    (config-file "/etc/wpa_supplicant/wpa_supplicant.conf")))

			      (elogind-service-type
			       c => (elogind-configuration (handle-lid-switch 'ignore)))
			      )	;;end of modify-services
			     ))	;;end of services

		  ;; Allow resolution of '.local' host names with mDNS.
		  (name-service-switch %mdns-host-lookup-nss)

		  ;;blacklist ugly sound speaker, blacklist ideapad_laptop for prevent soft blocking wlan
		  (kernel-arguments '("modprobe.blacklist=pcspkr,snd_pcsp,bluetooth,ideapad_laptop"))

		  ) ;;end of operating-system

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

end of thread, other threads:[~2019-05-04 11:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03 15:36 G-Expressions manual. change user shell in guix config.scm znavko
2019-05-04  3:11 ` rendaw
2019-05-04  3:13   ` rendaw
2019-05-04  6:11 ` rendaw
2019-05-04 10:53 ` znavko
2019-05-04 11:06   ` rendaw
2019-05-04 11:19   ` znavko
2019-05-04 11:24     ` rendaw
2019-05-04 11:29     ` znavko
2019-05-04 11:36       ` rendaw
2019-05-04 11:48       ` znavko
2019-05-04 11:50         ` rendaw

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.