Re: Trying to guix deploy to a local VM created with guix system vm

2020-12-08 Thread Jeremy Korwin-Zmijowski
Mea Culpa !

I tried my script on an another computer and it is broken. Oops.

I will update it (already understand why Janneke did his script that
way haha).

I will come back to you as soon as possible !

Take care,

Jérémy




Re: NAS drive

2020-12-08 Thread Tobias Geerinckx-Rice

Roy Lemmon 写道:

Sorry but it's been a long day ...


Here too :-)


I have to specify the nfs package don't I ?


The ‘NFS package’ in

 (file-append nfs-utils "/sbin/mount.nfs")

is nfs-utils, which is a variable defined in the (gnu packages 
nfs) Guile module.


As you note, modules need to be imported first, which is what


(use-modules (gnu packages nfs))
(use-service-modules desktop networking ssh xorg mail)


does.  This is the correct variant for your use case: you care 
only about the package which provides mount.nfs to clients, not 
about the server which is what (gnu services nfs) provides.


Aside: the above snippet is completely equivalent to both:

 (use-modules (gnu packages nfs))
 (use-modules (gnu services desktop)
  (gnu services networking)
  (gnu services ssh)
  (gnu services xorg)
  (gnu services mail))

and

 (use-package-modules nfs)
 (use-service-modules desktop networking ssh xorg mail)

USE-{PACKAGE,SERVICE}-MODULES is Guix-specific syntactic sugar 
that saves a lot of space and typing when you're importing many 
package & service modules, as most people do.


Kind regards,

T G-R


signature.asc
Description: PGP signature


Re: NAS drive

2020-12-08 Thread Roy Lemmon
Hi,

Thanks for the explanation. It makes a lot of sense to me. I will try this
later tonight.

Cheers
Roy.

On Tue, 8 Dec 2020, 18:46 Tobias Geerinckx-Rice,  wrote:

> Roy Lemmon 写道:
> > Sorry but it's been a long day ...
>
> Here too :-)
>
> > I have to specify the nfs package don't I ?
>
> The ‘NFS package’ in
>
>   (file-append nfs-utils "/sbin/mount.nfs")
>
> is nfs-utils, which is a variable defined in the (gnu packages
> nfs) Guile module.
>
> As you note, modules need to be imported first, which is what
>
> > (use-modules (gnu packages nfs))
> > (use-service-modules desktop networking ssh xorg mail)
>
> does.  This is the correct variant for your use case: you care
> only about the package which provides mount.nfs to clients, not
> about the server which is what (gnu services nfs) provides.
>
> Aside: the above snippet is completely equivalent to both:
>
>   (use-modules (gnu packages nfs))
>   (use-modules (gnu services desktop)
>(gnu services networking)
>(gnu services ssh)
>(gnu services xorg)
>(gnu services mail))
>
> and
>
>   (use-package-modules nfs)
>   (use-service-modules desktop networking ssh xorg mail)
>
> USE-{PACKAGE,SERVICE}-MODULES is Guix-specific syntactic sugar
> that saves a lot of space and typing when you're importing many
> package & service modules, as most people do.
>
> Kind regards,
>
> T G-R
>


Re: NAS drive

2020-12-08 Thread Roy Lemmon
Sorry but it's been a long day ...

I have to specify the nfs package don't I ? So is that done in use-modules
or use-service-models, e.g.

(use-modules (gnu packages nfs))
(use-service-modules desktop networking ssh xorg mail)

or

use-modules (gnu))
(use-service-modules desktop networking ssh xorg mail nfs)





On Tue, Dec 8, 2020 at 3:30 PM Tobias Geerinckx-Rice  wrote:

> Roy Lemmon 写道:
> > Thanks for your email. Where
> >  in the .scm file do those lines go ? In the:
> >
> > (services
> >  (append
> >   (list
> >
> > section ?
>
> No, on the same (top) level of your operating-system record.
>
> Kind regards,
>
> T G-R
>


-- 

Roy Lemmon
STFC Daresbury Laboratory
United Kingdom



NAS hardware recommendations

2020-12-08 Thread Pierre Neidhardt
Hi Guix!

Has anyone had luck installing Guix on a NAS?
If so, which one?

If not, which NAS hardware would you recommend?
I'm looking for

- something as open as possible;
- 3-4 bays;
- lowest consumption possible;
- Btrfs support.

Any tips?

Cheers!

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


signature.asc
Description: PGP signature


Re: NAS drive

2020-12-08 Thread Tobias Geerinckx-Rice

Roy Lemmon 写道:

Thanks for your email. Where
 in the .scm file do those lines go ? In the:

(services
 (append
  (list

section ?


No, on the same (top) level of your operating-system record.

Kind regards,

T G-R


signature.asc
Description: PGP signature


Re: NAS drive

2020-12-08 Thread Roy Lemmon
Hi Tobias,

Thanks for your email. Where
 in the .scm file do those lines go ? In the:

(services
 (append
  (list

section ?

Thanks
Roy.

On Tue, 8 Dec 2020, 15:01 Tobias Geerinckx-Rice,  wrote:

> Roy,
>
> Roy Lemmon 写道:
> > I wondered, after looking in the manual, whether this is a
> > setuid program
> > issue and so part of the Guix System. So I tried to set this in
> > the .scm
> > file as a service. However i didn't set any values as i was not
> > sure what
> > to put ...
>
> Try:
>
>   (setuid-programs
> (cons*
>   (file-append nfs-utils "/sbin/mount.nfs") ; or nfs4
>   %setuid-programs))
>
> Kind regards,
>
> T G-R
>


Re: NAS drive

2020-12-08 Thread Tobias Geerinckx-Rice

Roy,

Roy Lemmon 写道:
I wondered, after looking in the manual, whether this is a 
setuid program
issue and so part of the Guix System. So I tried to set this in 
the .scm
file as a service. However i didn't set any values as i was not 
sure what

to put ...


Try:

 (setuid-programs
   (cons*
 (file-append nfs-utils "/sbin/mount.nfs") ; or nfs4
 %setuid-programs))

Kind regards,

T G-R


signature.asc
Description: PGP signature


Trying to guix deploy to a local VM created with guix system vm

2020-12-08 Thread Jérémy Korwin-Zmijowski
Dear Guixters !

Having trouble to `guix deploy` to a VPS the last couples of days, I
tried the experiment locally on a VM powered by `guix system vm`.

Unfortunately, I haven't managed to successfuly deploy on a VM haha
(chances are failures are mine that's why I write to guix-help instead
of bug-guix…).

I created a script and system declarations to reproduce my attempts
(inspired by https://gitlab.com/janneke/deploy).

Here is the error I get so far :

La (1) machine suivante sera déployée :
  kitchen-deployed

guix deploy: déploiement vers kitchen-deployed...
guix deploy: error: impossible de déployer kitchen-deployed : SSH
authentication failed for 'localhost': Access denied for 'publickey'.
Authentication that can continue: publickey,password

Backtrace:
  17 (primitive-load "/home/jeko/.config/guix/current/bin/gu…")
In guix/ui.scm:
  2127:12 16 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1736:10 15 (with-exception-handler _ _ #:unwind? _ # _)
  1731:15 14 (with-exception-handler #
…)
In guix/status.scm:
776:4 13 (call-with-status-report _ _)
In ice-9/boot-9.scm:
  1736:10 12 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   632:37 11 (thunk)
   1301:8 10 (call-with-build-handler #
…)
In guix/scripts/deploy.scm:
   170:14  9 (_)
In guix/store.scm:
   1342:2  8 (map/accumulate-builds #
…)
In srfi/srfi-1.scm:
   586:17  7 (map1 (#< operating-system: #<))
In guix/store.scm:
   1301:8  6 (call-with-build-handler #
…)
In ice-9/boot-9.scm:
  1736:10  5 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/deploy.scm:
   144:28  4 (_)
In gnu/machine/ssh.scm:
   434:34  3 (deploy-managed-host #< operating-system: #<)
In ice-9/boot-9.scm:
  1670:16  2 (raise-exception _ #:continuable? _)
  1669:16  1 (raise-exception _ #:continuable? _)
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
ERROR:
  1. 


Cheers,

Jérémy
;; This is an operating system configuration template
;; for a "bare bones" setup, with no X11 display server.
(define-module (bare-bones))

(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules screen ssh)

(define-public %bare-bones
  (operating-system
   (host-name "kitchen")
   (timezone "Europe/Paris")
   (locale "fr_FR.utf8")

   ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
   ;; target hard disk, and "my-root" is the label of the target
   ;; root file system.
   (bootloader (bootloader-configuration
		(bootloader grub-bootloader)
		(target "/dev/sda")))
   (file-systems (cons (file-system
			(device "/dev/sda1")
			(mount-point "/")
			(type "ext4"))
   %base-file-systems))

   ;; Globally-installed packages.
   (packages (cons screen %base-packages))

   ;; Add services to the baseline: a DHCP client and
   ;; an SSH server.
   (services
(append
 (list
  (service dhcp-client-service-type)
  (service openssh-service-type
   (openssh-configuration
		(openssh openssh-sans-x)
		(permit-root-login 'without-password)
		(authorized-keys
		 `(("root" ,(local-file "id_rsa.pub"
		(port-number 22
 (modify-services
  %base-services
  (guix-service-type
   config => (guix-configuration
		  (inherit config)
		  (authorized-keys
		   (append
		(list (local-file "/etc/guix/signing-key.pub"))
		%default-authorized-guix-keys)

%bare-bones
;; This is a Guix deployment of a "bare bones" setup, with
;; no X11 display server, to a machine with an SSH daemon
;; listening on localhost:. A configuration such as this
;; may be appropriate for virtual machine with ports
;; forwarded to the host's loopback interface.

(use-modules (bare-bones))

(define %system
  (operating-system
   (inherit %bare-bones)
   (host-name "kitchen-deployed")))

(list (machine
   (operating-system %system)
   (environment managed-host-environment-type)
   (configuration (machine-ssh-configuration
   (host-name "localhost")
   (system "x86_64-linux")
   (user "root")
   (identity "id_rsa")
		   (host-key "ssh-ed25519 C3NzaC1lZDI1NTE5IOaYzLHn1PtYIMxl0VY6JO7Xo94ZP41J/gY1aIniQZx2")
   (port 10022)


deploy-vm.sh
Description: application/shellscript


Re: NAS drive

2020-12-08 Thread Roy Lemmon
Hi Pierre,

Sure. The exact response is:

rlemmon@parton ~$ sudo mount -t nfs 192.168.1.17:/Multimedia/Music/Classical
/mnt/nas
Password:
mount: /mnt/nas: bad option; for several filesystems (e.g. nfs, cifs) you
might need a /sbin/mount. helper program.
rlemmon@parton ~$

I wondered, after looking in the manual, whether this is a setuid program
issue and so part of the Guix System. So I tried to set this in the .scm
file as a service. However i didn't set any values as i was not sure what
to put ...

Cheers
Roy.

On Tue, Dec 8, 2020 at 10:07 AM Pierre Neidhardt  wrote:

> Hi Roy!
>
> sorry, I know nothing about NASes.
>
> That said, can you provide more details, e.g. the exact response that
> you get.
>
> > I am wondering whether I am running into a permissions issue. Obviously
> > when I install nfs-utils I am running this as myself rather than the
> > system.
>
> In my understanding, mounting tools are setuid programs and as such
> should be installed as part of your Guix System, not as user.  (To be
> confirmed.)
>
> Hope that helps!
>
> --
> Pierre Neidhardt
> https://ambrevar.xyz/
>


-- 

Roy Lemmon
STFC Daresbury Laboratory
United Kingdom