Guix home executables are not executable

  • Done
  • quality assurance status badge
Details
3 participants
  • Aleksandr Vityazev
  • Maxime Devos
  • Nick Zalutskiy
Owner
unassigned
Submitted by
Nick Zalutskiy
Severity
normal
N
N
Nick Zalutskiy wrote on 26 Dec 2021 18:03
(address . bug-guix@gnu.org)
66a55c86-8caf-489f-8fce-1a65e67a6780@www.fastmail.com
I'd like to use `guix home` to symlink an executable into my home directory.

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

Toggle quote (18 lines)
> (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: file
A
A
Aleksandr Vityazev wrote on 26 Dec 2021 22:44
(name . Nick Zalutskiy)(address . nick@const.fun)(address . 52807@debbugs.gnu.org)
87fsqfjb2n.fsf@posteo.org
Hi,

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

Toggle quote (31 lines)
> 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:

Toggle snippet (8 lines)
-- 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.

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
N
N
Nick Zalutskiy wrote on 26 Dec 2021 23:25
(name . Aleksandr Vityazev)(address . avityazev@posteo.org)(address . 52807@debbugs.gnu.org)
78b0a8f3-d49a-47ec-b46a-bfaaedcb2f0d@www.fastmail.com
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:
Toggle quote (58 lines)
> 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
M
M
Maxime Devos wrote on 27 Dec 2021 09:48
(address . 52807-done@debbugs.gnu.org)
f022f5e7c308c1b3cfe05ce1267ce83089ee9eea.camel@telenet.be
Hi,

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

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

Greetings (and closing),
Maxime.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 52807@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52807
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch