Skip to content

Commit ff1256f

Browse files
committed
allow switching between home specialisations
1 parent a0874a4 commit ff1256f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/home.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,13 @@ impl HomeRebuildArgs {
9999

100100
debug!(?prev_generation);
101101

102-
let spec_location =
103-
PathBuf::from(std::env::var("HOME")?).join(".local/share/home-manager/specialisation");
104-
105-
let current_specialisation = std::fs::read_to_string(spec_location.to_str().unwrap()).ok();
106-
107102
let target_specialisation = if self.no_specialisation {
108103
None
109104
} else {
110-
current_specialisation.or(self.specialisation)
105+
let spec_location = PathBuf::from(std::env::var("HOME")?)
106+
.join(".local/share/home-manager/specialisation");
107+
self.specialisation
108+
.or(std::fs::read_to_string(spec_location).ok())
111109
};
112110

113111
debug!("target_specialisation: {target_specialisation:?}");

0 commit comments

Comments
 (0)