Skip to content

Commit

Permalink
Add atomic update persistence list for SteamOS 3.6+
Browse files Browse the repository at this point in the history
  • Loading branch information
5310 committed Dec 14, 2024
1 parent 6beefac commit 5bdc2a0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/planner/steam_deck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,28 @@ impl Planner for SteamDeck {
.await
.map_err(PlannerError::Action)?;
actions.push(create_bind_mount_unit.boxed());

let create_atomic_update_buf = format!(
"\
/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\
",
persistence = persistence.display(),
);
let create_atomic_update_unit = CreateFile::plan(
"/etc/atomic-update.conf.d/nix.conf",
None,
None,
0o0644,
create_atomic_update_buf,
false,
)
.await
.map_err(PlannerError::Action)?;
actions.push(create_bind_mount_unit.boxed());
} else {
let revert_clean_streamos_nix_offload = RevertCleanSteamosNixOffload::plan()
.await
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.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

0 comments on commit 5bdc2a0

Please sign in to comment.