-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use cachix-action on a NixOS host #102
Comments
How exactly are you running github runner? |
May I ask what do you mean with this? This is the
The runner is simply enabled in my |
Could you also paste configuration.nix snippet so I can reproduce? |
Sure! Here it is: {
services.github-runner = {
enable = true;
url = "https://github.com/project";
tokenFile = "/secrets/github-runner/token";
replace = true;
};
nix.extraOptions = ''
tarball-ttl = 0
access-tokens = github.com=token
'';
} |
It seems like the user doesn't have access to the profile, I can take a look at this next week. |
Is there anything I can do to help? I could try to give it a go as it may be a good learning opportunity for me :-) |
You can check who's the owner of /nix/var/nix/profiles/per-user/github-runner and under what user does the cachix-install commands run under |
So, I took a look a few days ago but then I got sidetracked. It seems that everything is owned by |
I'll take a look tomorrow! |
Sorry, actually the builds are running under |
I have same error, @peperunas please tell me how you fixed it? |
Unfortunately, I didn’t solve it.
…On 20 Feb 2022, 20:12 +0000, Kirill Kuznetsov ***@***.***>, wrote:
@peperunas please tell me how you fixed it?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I solved it with my cachix-action fork, and adding cachix to services.github-runner.extraPackages |
Happy to accept a PR to skip installation if cachix is already installed! |
Ok, done: #109 |
i'm facing this as well and i'm noticing that even though so the following still tries to install cachix (and fails to do so):
i would expect the above to work. that's because i verified in a separate step that cachix is indeed available:
here's some proof from a slightly modified version of the above where i modified the install script to rely on the external existence check: |
I'll try to get #109 merged to address this. |
Released v11 that addresses the issues here, please let me know if it works so we can close :) |
i just tried and the installation of cachix, or rather skipping thereof in my case, works! my remaining issue is in getting the cachix settings to actually take effect. this is from an SSH session with the runner's context of this CI job instance:
i'm not sure where this global |
i found what i consider a workaround to the issue i've explained. in my situation there's a nixos host that runs multiple nixos containers which in turn run github-runner. to get the "github-runner" user trusted to effectively get cachix-action to work from a workflow, i added this to the host's and the container's nixos config: nix.settings.trusted-users = [
"root"
"github-runner"
];
users.users.github-runner = {
uid = 1000;
isSystemUser = true;
createHome = false;
group = "github-runner";
};
users.groups.github-runner = {}; only if i add this in both places is the host's nix-daemon happy with allowing the workflow to introduce ad-hoc extra-substituters |
Thanks! I'm closing this as it seems it's possible to use cachix-action on a NixOS host. Please reopen if any issues persist. |
What is the best way to set-up cachix on a NixOS host running with a
services.github-runner
?As per the issue raised on the NixOS matrix channel, this is a log I got from my attempt.
The text was updated successfully, but these errors were encountered: