Skip to content
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

Nix 2.13.3 -> 2.15.0 #428

Merged
merged 3 commits into from
May 1, 2023
Merged

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Apr 25, 2023

Description

Closes #286.

Checklist
  • Formatted with cargo fmt
  • Built with nix build
  • Ran flake checks with nix flake check
  • Added or updated relevant tests (leave unchecked if not applicable)
  • Added or updated relevant documentation (leave unchecked if not applicable)
  • Linked to related issues (leave unchecked if not applicable)
Validating with install.determinate.systems

If a maintainer has added the upload to s3 label to this PR, it will become available for installation via install.determinate.systems:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/$PR_NUMBER | sh -s -- install

@grahamc
Copy link
Member Author

grahamc commented Apr 25, 2023

The path that we care about here needs to be updated here, yeah?

// If the `$GITHUB_PATH` environment exists, we're almost certainly running on Github
// Actions, and almost certainly wants the relevant `$PATH` additions added.
if let Ok(github_path) = std::env::var("GITHUB_PATH") {
let mut buf = "/nix/var/nix/profiles/default/bin\n".to_string();
// Actions runners operate as `runner` user by default
if let Ok(Some(runner)) = User::from_name("runner") {
buf += &format!(
"/nix/var/nix/profiles/per-user/{}/profile/bin\n",
runner.name
);

@Hoverbear Hoverbear mentioned this pull request Apr 25, 2023
@Hoverbear
Copy link
Contributor

Thanks @abathur NixOS/nix@2384d36

@grahamc
Copy link
Member Author

grahamc commented Apr 26, 2023

Instead of writing out the /nix/var/nix.... path, we need to update to match this commit: NixOS/nix@2384d36

...which implies we need to capture the XDG_STATE_HOME value from the parent before we sudo and pass it through. If XDG_STATE_HOME isn't set, default to $HOME/.local/state -- again captured before we sudo.

@grahamc
Copy link
Member Author

grahamc commented Apr 27, 2023

...which implies we need to capture the XDG_STATE_HOME value from the parent before we sudo and pass it through. If XDG_STATE_HOME isn't set, default to $HOME/.local/state -- again captured before we sudo.

We might be able to skip all this extra complexity and hard-code it, but I'm wondering if that would break users of the action on self-hosted runners.

@Hoverbear
Copy link
Contributor

Doing a full VM/container test pass on this.

@Hoverbear
Copy link
Contributor

Passes! ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants