[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52807: Guix home executables are not executable
From: |
Nick Zalutskiy |
Subject: |
bug#52807: Guix home executables are not executable |
Date: |
Sun, 26 Dec 2021 17:25:08 -0500 |
User-agent: |
Cyrus-JMAP/3.5.0-alpha0-4525-g8883000b21-fm-20211221.001-g8883000b |
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