mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #696] Please add documentation on using nix in an action #442
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#442
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dsyer on GitHub (May 21, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/696
It's really great that the nix package for act is up to date, and that the README has instructions about how to install it. It is surprising therefore that you can't use it to run an action with
cachix/install-nix-action(cf #559). The fact that the README tells me how to use nix makes me think there might be a way to do it, but I can't figure it out on my own.@catthehacker commented on GitHub (May 21, 2021):
Docker containers are much different than OS running on your host so it's not possible to replicate behaviour 1:1. I've not used
nixor NixOS so I don't know much about them.@dsyer commented on GitHub (May 21, 2021):
It's hard to figure out who maintains the nix part of
actthen (the package and the docs). Is it @ryantm (or is that you anyway)? If someone cares enough to want to create that package they probably understand nix enough to figure this one out.@catthehacker commented on GitHub (May 21, 2021):
The package of
actfor Nix is totally different thing comparing to havenixworking inact(Docker container)@catthehacker commented on GitHub (May 21, 2021):
As I've mentioned in #559 it is currently not possible to run
nixaction inactdue to the way that action works and howactworks.actcurrently doesn't work well with non-root account due to the way how Docker works and it's long road before it's going to be fixed.nixaction doesn't work with root account.@ryantm commented on GitHub (May 21, 2021):
Plenty of nix commands work on top of act but maybe not the installer.
@dsyer commented on GitHub (May 21, 2021):
I'm not sure I understand, and it will be hard work to educate me, so forget about it unless you are feeling kind. I can create a docker image like this:
and then run it and install nix (
RUN curl -L https://nixos.org/nix/install | sh). So it works in a container if you set up the right base. Can we not somehow persuadeactwithcachixto do the same thing?@dsyer commented on GitHub (May 21, 2021):
I can also do this and then I think the cachix action is running successfully:
But when I try to use nix in a workflow step it crashes with
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I). So it feels like I blundered into something that nearly works, but since I don't really know how I got here it's going to be hard to get any further on my own.@catthehacker commented on GitHub (May 21, 2021):
Well, no, because
actis running everything as root currently and it has to be fixed first, either inactorcachix/install-nix/actionhas to support root installation.@dsyer commented on GitHub (May 25, 2021):
OK, so I have something that works. It it a hack? I don't know. Could we make it work more easily? Please advise. I wrote some notes here: https://github.com/scratches/act-demo.
The base image is this:
Despite the entrypoint,
actalways runs the action usingbash --noprofile ...(I think), so I also have to add. ~/.profileto my job step:Then I run
actas normal, but using the custom base image built from theDockerfileabove (in-P).@github-actions[bot] commented on GitHub (Jun 25, 2021):
Issue is stale and will be closed in 14 days unless there is new activity