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

Persist files added to /etc past system updates for SteamOS 3.6+ #1355

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions src/planner/steam_deck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ impl Planner for SteamDeck {
.map_err(PlannerError::Action)?;
actions.push(create_bind_mount_unit.boxed());
} else {
let revert_clean_streamos_nix_offload = RevertCleanSteamosNixOffload::plan()
let revert_clean_steamos_nix_offload = RevertCleanSteamosNixOffload::plan()
.await
.map_err(PlannerError::Action)?;
actions.push(revert_clean_streamos_nix_offload.boxed());
actions.push(revert_clean_steamos_nix_offload.boxed());

let ensure_steamos_nix_directory = EnsureSteamosNixDirectory::plan()
.await
Expand All @@ -270,6 +270,27 @@ impl Planner for SteamDeck {
actions.push(start_nix_mount.boxed());
}

if std::path::Path::new("/etc/atomic-update.conf.d").exists() {
let create_atomic_update_buf = "\
/etc/fish/conf.d/nix.fish\n\
/etc/nix/**\n\
/etc/profile.d/nix.sh\n\
/etc/systemd/system/nix-daemon.socket\n\
/etc/tmpfiles.d/nix-daemon.conf\n\
";
let create_atomic_update_unit = CreateFile::plan(
"/etc/atomic-update.conf.d/nix-installer.conf",
None,
None,
0o0644,
create_atomic_update_buf.to_string(),
false,
)
.await
.map_err(PlannerError::Action)?;
actions.push(create_atomic_update_unit.boxed());
}

let ensure_symlinked_units_resolve_buf = "\
[Unit]\n\
Description=Ensure Nix related units which are symlinked resolve\n\
Expand Down
12 changes: 12 additions & 0 deletions tests/fixtures/linux/steam-deck.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@
},
"state": "Completed"
},
{
"action": {
"action_name": "create_file",
"path": "/etc/atomic-update.conf.d/nix-installer.conf",
"user": null,
"group": null,
"mode": 420,
"buf": "/etc/fish/conf.d/nix.fish\n/etc/nix/**\n/etc/profile.d/nix.sh\n/etc/systemd/system/nix-daemon.socket\n/etc/tmpfiles.d/nix-daemon.conf\n",
"force": false
},
"state": "Completed"
},
{
"action": {
"action_name": "start_systemd_unit",
Expand Down