-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Nix to be installed inside Docker agents as root or without systemd #43
Comments
Refs #40 |
@soareschen are you able to specify an docker image? In that case it might be easier to just use NixOS/nix as the base. |
You can switch the base image using
|
I'm not familiar with self-hosted setups, would something like NixOS/nixpkgs#116775 be enough or does it need docker for runtime isolation? |
You need |
It seems like we need an option to run as root (as per the summary). Could it be as simple as doing a |
@dsyer wouldn't you expect this action to do nothing if you're running a docker image with Nix preinstalled? |
I guess, but it doesn't - instead it barfs. I did get it working with a custom image: nektos/act#696. Not sure where to take that really - I can use it myself, but if others want the same with less hassle, is it better to ask for a change here or in |
Our team is using self-hosted runner in container(https://github.com/actions-runner-controller/actions-runner-controller). If you want to install nix to container, rewrite install-script like this.
|
I just walked into the same problem but while debugging an action with act. I think based on the error output it would be enough to conditionally enable the daemon based on the existence of the
|
Nix support for Docker needs a lot of love. I'm not sure I'd like to support it in current form, although I'm not against if someone opens a PR to add something like |
I don't like that option. It would require me to change the action when running locally with act. |
The installer now does a single-user installation if there's no systemd. Can someone report if it works now? |
c664ef3 broke it.
There are multiple entries for build-user-groups in /tmp/nix.conf which seems to be another bug but I think this is not enough. $ cat /tmp/nix.conf
max-jobs = auto
trusted-users = root root
experimental-features = nix-command flakes
build-users-group =
max-jobs = auto
trusted-users = root root
experimental-features = nix-command flakes
build-users-group = |
I got it working like:
|
@SuperSandro2000 How can I reproduce it? |
I cloned the nixpkgs repo, updated the nix-install action, opened a |
You can easily reproduce this on my config $ git clone https://github.com/lovesegfault/nix-config
$ cd nix-config
$ nix develop
$ act push |
It seems that act doesn't set the $USER variable? https://github.com/cachix/install-nix-action/runs/4212609982?check_suite_focus=true |
For the record, here's the error I get with the aforementioned reproducer:
|
#111 fixes it and adds a test. |
Self hosted runners for GitHub Actions can often be run from Docker containers such as https://github.com/tcardonne/docker-github-runner. In the default setup, the agent runs as root and systemd does not work well with Docker. It is often a hassle to tweak the Docker containers to run as regular user just to support Nix, and we can't always do that when the self hosted runners are maintained by different team of people.
The text was updated successfully, but these errors were encountered: