unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* nnn-service-type for guix home
@ 2021-10-24 22:37 jgart
  2021-10-24 23:05 ` Oleg Pykhalov
  0 siblings, 1 reply; 4+ messages in thread
From: jgart @ 2021-10-24 22:37 UTC (permalink / raw)
  To: Guix Devel

Hi Guixers,

Does it make sense to add nnn's configuration to the bash-service-type or to
create a new service altogether?

nnn is configured by setting environment variables:

https://github.com/jarun/nnn/wiki/Usage#configuration

I had originally proposed an nnn config for guix-home-manager:

https://framagit.org/tyreunom/guix-home-manager/-/issues/15


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

* Re: nnn-service-type for guix home
  2021-10-24 22:37 nnn-service-type for guix home jgart
@ 2021-10-24 23:05 ` Oleg Pykhalov
  2021-10-24 23:41   ` jgart
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Pykhalov @ 2021-10-24 23:05 UTC (permalink / raw)
  To: jgart; +Cc: Guix Devel

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

Hi,

jgart <jgart@dismail.de> writes:

> Does it make sense to add nnn's configuration to the bash-service-type
> or to create a new service altogether?
>
> nnn is configured by setting environment variables:
>
> https://github.com/jarun/nnn/wiki/Usage#configuration

For environment variables I think the best way is extending
'home-environment-variables-service-type' [1].  This approach could
configure nnn for not only for Bash, but e.g. Zsh.

[1] https://guix.gnu.org/en/manual/devel/en/html_node/Essential-Home-Services.html

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

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

* Re: nnn-service-type for guix home
  2021-10-24 23:05 ` Oleg Pykhalov
@ 2021-10-24 23:41   ` jgart
  2021-10-25 11:34     ` Oleg Pykhalov
  0 siblings, 1 reply; 4+ messages in thread
From: jgart @ 2021-10-24 23:41 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: Guix Devel

On Mon, 25 Oct 2021 02:05:31 +0300 Oleg Pykhalov <go.wigust@gmail.com> wrote:
> Hi,
> 
> jgart <jgart@dismail.de> writes:
> 
> > Does it make sense to add nnn's configuration to the bash-service-type
> > or to create a new service altogether?
> >
> > nnn is configured by setting environment variables:
> >
> > https://github.com/jarun/nnn/wiki/Usage#configuration
> 
> For environment variables I think the best way is extending
> 'home-environment-variables-service-type' [1].  This approach could
> configure nnn for not only for Bash, but e.g. Zsh.
> 
> [1] https://guix.gnu.org/en/manual/devel/en/html_node/Essential-Home-Services.html

Ah, thanks.

So, something like this?

(simple-service 'nnn-service-type
		home-environment-variables-service-type
		`(("NNN_BMS" . "d:$HOME/Documents;D:$HOME/Docs archive/")
          ("NNN_SSHFS" . ,(string-append sshfs "-o reconnect,idmap=user")) ; reference sshfs from store somehow
          ("NO_COLOR" . 1)
          ...))


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

* Re: nnn-service-type for guix home
  2021-10-24 23:41   ` jgart
@ 2021-10-25 11:34     ` Oleg Pykhalov
  0 siblings, 0 replies; 4+ messages in thread
From: Oleg Pykhalov @ 2021-10-25 11:34 UTC (permalink / raw)
  To: jgart; +Cc: Guix Devel

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

jgart <jgart@dismail.de> writes:

[…]

> So, something like this?
>
> (simple-service 'nnn-service-type
> 		home-environment-variables-service-type
> 		`(("NNN_BMS" . "d:$HOME/Documents;D:$HOME/Docs archive/")
>           ("NNN_SSHFS" . ,(string-append sshfs "-o reconnect,idmap=user")) ; reference sshfs from store somehow
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

According to [1] this should be something like:
--8<---------------cut here---------------start------------->8---
(simple-service 'some-useful-env-vars-service
                home-environment-variables-service-type
                `(("NNN_SSHFS" . ,#~(format #f "~s"
                                            (format #f "~a -o reconnect,idmap=user"
                                                    #$(file-append sshfs "/bin/sshfs"))))))
--8<---------------cut here---------------end--------------->8---

which will be evaluated to:
--8<---------------cut here---------------start------------->8---
$ guix home build home.scm
/gnu/store/...-home

$ grep -RF NNN_SSHFS /gnu/store/...-home/
/gnu/store/...-home/setup-environment:export NNN_SSHFS="/gnu/store/...-sshfs-2.10/bin/sshfs -o reconnect,idmap=user"
--8<---------------cut here---------------end--------------->8---

[1] https://github.com/jarun/nnn/wiki/Usage#configuration

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

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

end of thread, other threads:[~2021-10-25 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 22:37 nnn-service-type for guix home jgart
2021-10-24 23:05 ` Oleg Pykhalov
2021-10-24 23:41   ` jgart
2021-10-25 11:34     ` Oleg Pykhalov

Code repositories for project(s) associated with this public inbox

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

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