From mboxrd@z Thu Jan 1 00:00:00 1970 From: znavko@disroot.org Subject: G-Expressions manual. change user shell in guix config.scm Date: Fri, 03 May 2019 15:36:27 +0000 Message-ID: <020ade7dd57cfe2182b3aa360a8cf13d@disroot.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="--=_RainLoop_200_402674811.1556897787" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:33907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMaEm-00046C-Aq for help-guix@gnu.org; Fri, 03 May 2019 11:36:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMaEk-00077u-Uq for help-guix@gnu.org; Fri, 03 May 2019 11:36:36 -0400 Received: from knopi.disroot.org ([178.21.23.139]:50442) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMaEk-0006tr-7Q for help-guix@gnu.org; Fri, 03 May 2019 11:36:34 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B38B32ABD7 for ; Fri, 3 May 2019 17:36:31 +0200 (CEST) Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RQhtu8xK0TY0 for ; Fri, 3 May 2019 17:36:29 +0200 (CEST) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix ----=_RainLoop_200_402674811.1556897787 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I want to try to use G-expressions to change 'mom' user shell to dash.=0A= I have this error:=0A=0A# guix system reconfigure config-znavko.scm=0A...= =0Abuilding /gnu/store/zhmd8fr5v86wnaf6apcz4281c008fjv5-shepherd-user-hom= es.scm.drv...=0Abuilding /gnu/store/6wnbkfdqy3qmbcjz00d1w5p8mw1rkyaa-shel= ls.drv...=0A/builder for `/gnu/store/6wnbkfdqy3qmbcjz00d1w5p8mw1rkyaa-she= lls.drv' failed with exit code 1=0Abuild of /gnu/store/6wnbkfdqy3qmbcjz00= d1w5p8mw1rkyaa-shells.drv failed=0AView build log at '/var/log/guix/drvs/= 6w/nbkfdqy3qmbcjz00d1w5p8mw1rkyaa-shells.drv.bz2'.=0Acannot build derivat= ion `/gnu/store/36ah9x5q8nj6y01fs32brcndmkgyvqmv-etc.drv': 1 dependencies= couldn't be built=0Abuilding /gnu/store/kvdsb795wn1ic8p9kcdsbkd9vw5v4dm2= -shepherd.conf.drv...=0Acannot build derivation `/gnu/store/cmfly4pn3hs2y= 38km0l3yn3phkxy84xj-system.drv': 1 dependencies couldn't be built=0Aguix = system: error: build of `/gnu/store/cmfly4pn3hs2y38km0l3yn3phkxy84xj-syst= em.drv' failed=0A=0A# tail -n1 /var/log/guix/drvs/6w/nbkfdqy3qmbcjz00d1w5= p8mw1rkyaa-shells.drv=0AERROR: Wrong type to apply: "/gnu/store/bqmib4vf9= mr8dkqx4dqpcqrnb93giwci-dash-0.5.10.2"=0Ait is here:=0A(user-account (nam= e "mom") (group "users")=0A(supplementary-groups '("wheel" "netdev" "audi= o" "video"))=0A(home-directory "/home/mom")=0A(shell #~(#$dash)))=0AI rea= d Guix Refernce Manual 'G-Expressions' section, but there types described= quite a little: Scheme Syntax: #~exp Scheme Syntax: (gexp exp) =0A=0A= Return a G-expression containing exp. exp may contain one or more of the= following forms: #$obj (ungexp obj) =0A=0A Introduce a reference to ob= j. obj may have one of the supported types, for example a package or a de= rivation, in which case the ungexp form is replaced by its output file na= me=E2=80=94e.g., "/gnu/store/=E2=80=A6-coreutils-8.22. =0A=0A If obj is a= list, it is traversed and references to supported objects are substitute= d similarly. =0A=0A If obj is another gexp, its contents are inserted and= its dependencies are added to those of the containing gexp. =0A=0A If ob= j is another kind of object, it is inserted as is. =0AMy wrong config= is attached.=0A=0ABut I've found on github workable example https://gith= ub.com/meiyopeng/guix-config/blob/master/meiyo/systems/default.scm=0A=0AA= nd rewrite config with file-append Scheme procedure. This works:=0A=0A (u= ser-account (name "mom") (group "users")=0A (supplementary-groups '("whee= l" "netdev" "audio" "video"))=0A (home-directory "/home/mom")=0A (shell (= file-append dash "/bin/dash")))=0A=0ABut I am confused, cause I do not kn= ow why config works without #~ and #~ but only file-append function? Is i= t still G-Expression (shell (file-append dash "/bin/dash"))? ----=_RainLoop_200_402674811.1556897787 Content-Type: application/octet-stream; name="config-znavko.scm" Content-Disposition: attachment; filename="config-znavko.scm" Content-Transfer-Encoding: base64 Oy0qLSBtb2RlOiBTY2hlbWU7IC0qLQo7O3RoaXMgaXMgem5hdmtvJ3MgY3V0ZSBjb25maWcK Cih1c2UtbW9kdWxlcyAoZ251KSAoZ251IHN5c3RlbSBuc3MpCgkgICAgIChnbnUgc3lzdGVt IGxvY2FsZSkgOztmb3IgbG9jYWxlLWRlZmluaXRpb24KCSAgICAgKGdudSBzZXJ2aWNlcyBk ZXNrdG9wKQoJICAgICAoc3JmaSBzcmZpLTEpCSAgICAgICA7O2ZvciByZW1vdmUgZnVuY3Rp b24KCSAgICAgKGdudSBzZXJ2aWNlcyBuZXR3b3JraW5nKSA7O2ZvciByZW1vdmUgbnRwCgkg ICAgIChnbnUgc2VydmljZXMgYXZhaGkpICAgICAgOztmb3IgcmVtb3ZlIGF2YWhpCgkgICAg IChnbnUgc2VydmljZXMgeG9yZykKCSAgICAgKGdudSBwYWNrYWdlcyBhZG1pbikgOztmb3Ig d3BhX3N1cHBsaWNhbnQKCSAgICAgKGdudSBwYWNrYWdlcyBzaGVsbHMpCgkgICAgIChndWl4 IGdleHApCgkgICAgICkKCih1c2Utc2VydmljZS1tb2R1bGVzIGRlc2t0b3ApCih1c2UtcGFj a2FnZS1tb2R1bGVzIGNlcnRzIGdub21lKQoKKG9wZXJhdGluZy1zeXN0ZW0gKGhvc3QtbmFt ZSAiYW50ZWxvcGUiKSAodGltZXpvbmUgIkV1c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