unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Aleksandr Vityazev <avityazev@posteo.org>
To: "Nick Zalutskiy" <nick@const.fun>
Cc: 52807@debbugs.gnu.org
Subject: bug#52807: Guix home executables are not executable
Date: Sun, 26 Dec 2021 21:44:16 +0000	[thread overview]
Message-ID: <87fsqfjb2n.fsf@posteo.org> (raw)
In-Reply-To: <66a55c86-8caf-489f-8fce-1a65e67a6780@www.fastmail.com> (Nick Zalutskiy's message of "Sun, 26 Dec 2021 12:03:30 -0500")

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




  reply	other threads:[~2021-12-26 21:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-26 17:03 bug#52807: Guix home executables are not executable Nick Zalutskiy
2021-12-26 21:44 ` Aleksandr Vityazev [this message]
2021-12-26 22:25   ` Nick Zalutskiy
2021-12-27  8:48     ` Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsqfjb2n.fsf@posteo.org \
    --to=avityazev@posteo.org \
    --cc=52807@debbugs.gnu.org \
    --cc=nick@const.fun \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).