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

Add support for ostree-based Linux distributions #586

Merged
merged 3 commits into from
Jul 24, 2023

Conversation

Hofer-Julian
Copy link
Contributor

Fixes #389
I've tested this planner on Fedora Silverblue and Endless OS.

The content is inspired by the linux planner, the steamos planner and https://github.com/dnkmmr69420/nix-installer-scripts/blob/main/installer-scripts/silverblue-nix-installer.sh

Description
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

Fixes DeterminateSystems#389
I've tested this planner on Fedora Silverblue and Endless OS
@Hoverbear
Copy link
Contributor

Hoverbear commented Jul 21, 2023

Thanks for this! I'll need to do some testing. :)

(Don't worry about the CI failures here -- We need to rework our CI to better handle contributor PRs apparently...)

src/planner/ostree.rs Outdated Show resolved Hide resolved
@Hoverbear
Copy link
Contributor

It's a real bummer I can't seem to find any official silverblue vagrant boxes to use in the VM tests.

src/planner/ostree.rs Outdated Show resolved Hide resolved
plan.push(ensure_symlinked_units_resolve_unit.boxed());

// We need to remove this path since it's part of the read-only install.
let mut shell_profile_locations = ShellProfileLocations::default();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should make ShellProfileLocations::default() check if the items if candidate paths are read-only and exclude them...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played a bit with this, but couldn't find a good way to do this.
One alternative would be to stop erroring when this files cannot be created and logging warnings instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's punt it for now. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what that means 😅

src/planner/ostree.rs Outdated Show resolved Hide resolved
@Hoverbear
Copy link
Contributor

Hoverbear commented Jul 21, 2023

I found a few very minor tidy-ups and nits to address, otherwise this seems to work really well! Thanks so much!

  • Installed in a vm
  • Services have no errors
  • Ran some nix commands (nix run nixpkgs#hello, nix store gc etc)
  • Rebooted
  • Ran some more nix commands (nix run nixpkgs#hello, nix store gc etc)
  • Uninstalled
  • Installed again
  • Ran some nix commands (nix run nixpkgs#hello, nix store gc etc)
  • Ran sudo rpm-ostree install ripgrep
  • Rebooted (as suggested)
  • Ran some nix commands (nix run nixpkgs#hello, nix store gc etc)

I'd like to spend a bit of time learning more about ostree and seeing if we can use systemd-tmpfiles instead of the chattr dance before merging, too. -- After some poking I don't think it's going to work any better than chattr unless there is some way to do this with tmpfiles I haven't found.

@Hoverbear Hoverbear merged commit e84fd2b into DeterminateSystems:main Jul 24, 2023
4 of 5 checks passed
@Hoverbear
Copy link
Contributor

Thanks for this!

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.

A Fedora Silverblue planner
2 participants