unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52807: Guix home executables are not executable
@ 2021-12-26 17:03 Nick Zalutskiy
  2021-12-26 21:44 ` Aleksandr Vityazev
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Zalutskiy @ 2021-12-26 17:03 UTC (permalink / raw)
  To: 52807

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

I'd like to use `guix home` to symlink an executable into my home directory. 

Following simple configuration stored at `~/.dotfiles/home-configuration.scm`

> (use-modules
>   (gnu home)
>   (gnu packages)
>   (gnu home services)
>   (gnu services)
>   (guix gexp)
>   (gnu home services shells))
> 
> (home-environment
>   (services
>     (list (service
>             home-bash-service-type
>             (home-bash-configuration
>           (guix-defaults? #t)))
>       (simple-service 'my-files
>               home-files-service-type
>               `(("run" ,(local-file "run")))))))

`~/.dotfiles/run` is an executable file, after home reconfigure a `~/.run` symlink is created, however the file it is pointing to does _not_ have the execute bit set.

As a result, when I try to execute `~/.run` file I get a "Permission denied" error.

Thank you,

-Nick

[-- Attachment #2: Type: text/html, Size: 1830 bytes --]

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

* bug#52807: Guix home executables are not executable
  2021-12-26 17:03 bug#52807: Guix home executables are not executable Nick Zalutskiy
@ 2021-12-26 21:44 ` Aleksandr Vityazev
  2021-12-26 22:25   ` Nick Zalutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Aleksandr Vityazev @ 2021-12-26 21:44 UTC (permalink / raw)
  To: Nick Zalutskiy; +Cc: 52807

Hi,

On 2021-12-26, 12:03 -0500, "Nick Zalutskiy" <nick@const.fun> wrote:

>      I'd like to use `guix home` to symlink an executable into my home directory. 
>
>      Following simple configuration stored at `~/.dotfiles/home-configuration.scm`
>
>          (use-modules
>            (gnu home)
>            (gnu packages)
>            (gnu home services)
>            (gnu services)
>            (guix gexp)
>            (gnu home services shells))
>
>          (home-environment
>            (services
>              (list (service
>                      home-bash-service-type
>                      (home-bash-configuration
>                    (guix-defaults? #t)))
>                (simple-service 'my-files
>                        home-files-service-type
>                        `(("run" ,(local-file "run")))))))
>
>      `~/.dotfiles/run` is an executable file, after home reconfigure a `~/.run` symlink is created,
>      however the file it is pointing to does _not_ have the execute bit set.
>
>      As a result, when I try to execute `~/.run` file I get a "Permission denied" error.
>
>      Thank you,
>
>      -Nick
>
In the Guix manual you can find the following information about
local-file:

--8<---------------cut here---------------start------------->8---
-- Scheme Procedure: local-file FILE [NAME] [#:recursive? #f]
          [#:select? (const #t)]
          
When RECURSIVE? is true, the contents of FILE are added
     recursively; if FILE designates a flat file and RECURSIVE? is true,
     its contents are added, and its permission bits are kept.
--8<---------------cut here---------------end--------------->8---

So you can just do this:

#+begin_src scheme
(simple-service 'my-files
                home-files-service-type
                `(("run" ,(local-file "run" #:recursive? #t))))
#+end_src

-- 
Best regards,
Aleksandr Vityazev




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

* bug#52807: Guix home executables are not executable
  2021-12-26 21:44 ` Aleksandr Vityazev
@ 2021-12-26 22:25   ` Nick Zalutskiy
  2021-12-27  8:48     ` Maxime Devos
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Zalutskiy @ 2021-12-26 22:25 UTC (permalink / raw)
  To: Aleksandr Vityazev; +Cc: 52807

Indeed I missed this in the manual. Thank you!

I was trying to figure out how to close this... no luck.

-Nick

On Sun, Dec 26, 2021, at 4:44 PM, Aleksandr Vityazev wrote:
> Hi,
>
> On 2021-12-26, 12:03 -0500, "Nick Zalutskiy" <nick@const.fun> wrote:
>
>>      I'd like to use `guix home` to symlink an executable into my home directory. 
>>
>>      Following simple configuration stored at `~/.dotfiles/home-configuration.scm`
>>
>>          (use-modules
>>            (gnu home)
>>            (gnu packages)
>>            (gnu home services)
>>            (gnu services)
>>            (guix gexp)
>>            (gnu home services shells))
>>
>>          (home-environment
>>            (services
>>              (list (service
>>                      home-bash-service-type
>>                      (home-bash-configuration
>>                    (guix-defaults? #t)))
>>                (simple-service 'my-files
>>                        home-files-service-type
>>                        `(("run" ,(local-file "run")))))))
>>
>>      `~/.dotfiles/run` is an executable file, after home reconfigure a `~/.run` symlink is created,
>>      however the file it is pointing to does _not_ have the execute bit set.
>>
>>      As a result, when I try to execute `~/.run` file I get a "Permission denied" error.
>>
>>      Thank you,
>>
>>      -Nick
>>
> In the Guix manual you can find the following information about
> local-file:
>
> --8<---------------cut here---------------start------------->8---
> -- Scheme Procedure: local-file FILE [NAME] [#:recursive? #f]
>           [#:select? (const #t)]
>          
> When RECURSIVE? is true, the contents of FILE are added
>      recursively; if FILE designates a flat file and RECURSIVE? is true,
>      its contents are added, and its permission bits are kept.
> --8<---------------cut here---------------end--------------->8---
>
> So you can just do this:
>
> #+begin_src scheme
> (simple-service 'my-files
>                 home-files-service-type
>                 `(("run" ,(local-file "run" #:recursive? #t))))
> #+end_src
>
> -- 
> Best regards,
> Aleksandr Vityazev




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

* bug#52807: Guix home executables are not executable
  2021-12-26 22:25   ` Nick Zalutskiy
@ 2021-12-27  8:48     ` Maxime Devos
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Devos @ 2021-12-27  8:48 UTC (permalink / raw)
  To: Nick Zalutskiy, Aleksandr Vityazev; +Cc: 52807-done

Hi,

Nick Zalutskiy schreef op zo 26-12-2021 om 17:25 [-0500]:
> [...]
> I was trying to figure out how to close this... no luck.

https://debbugs.gnu.org/Developer.html has instructions on how to
close, reopen and tag bugs.

Greetings (and closing),
Maxime.





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

end of thread, other threads:[~2021-12-27  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-26 17:03 bug#52807: Guix home executables are not executable Nick Zalutskiy
2021-12-26 21:44 ` Aleksandr Vityazev
2021-12-26 22:25   ` Nick Zalutskiy
2021-12-27  8:48     ` Maxime Devos

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