[Nix-dev] fetchurl with executable bit?

Domen Kožar domen at dev.si
Mon Jan 18 21:04:25 CET 2016


I've tried, but Nix doesn't allow setting executable bit:

output path ‘/nix/store/h873wjrmvzx73di88b85mqm255gvjnng-blash.sh’ should
be a non-executable regular file

On Mon, Jan 18, 2016 at 8:03 PM, William Kennington <william at wkennington.com
> wrote:

> https://github.com/NixOS/nix/blob/master/corepkgs/fetchurl.nix has an
> option to set executable. Maybe these should be consolidated.
> On Mon, Jan 18, 2016 at 10:56 AM Domen Kožar <domen at dev.si> wrote:
>
>> aszlig pointed out:
>>
>>    postFetch = "chmod +x '$out'";
>>
>>
>>
>> On Mon, Jan 18, 2016 at 7:46 PM, Domen Kožar <domen at dev.si> wrote:
>>
>>> Hi all,
>>>
>>> I'd like to have a function that fetches a script from the url and
>>> stores it as an executable.
>>>
>>> Currently fetchurl doesn't support chmod:
>>> https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchurl/default.nix
>>>
>>>
>>> My current workaround is to do:
>>>
>>> pkgs.writeScript "foobar" (builtins.readFile (pkgs.fetchurl {..}))
>>>
>>> but that's rather ugly.
>>>
>>> Do we have something in nixpkgs that's better? Should fetchurl be
>>> improved?
>>>
>>> Domen
>>>
>>
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160118/c9dfc9d5/attachment.html 


More information about the nix-dev mailing list