Skip to content

Commit 1915f6e

Browse files
cdo256viperML
authored andcommitted
build and build-vm now default to output in ./result
This fixes #297.
1 parent a435be2 commit 1915f6e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
# NH Changelog
44

5+
## Unreleased
6+
7+
- `nh os build` and `nh os build-vm` now default to placing the output at
8+
`./result` instead of a temp directory.
9+
510
## 4.1.0
611

712
### Added

src/nixos.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,13 @@ impl OsRebuildArgs {
118118

119119
let out_path: Box<dyn crate::util::MaybeTempPath> = match self.common.out_link {
120120
Some(ref p) => Box::new(p.clone()),
121-
None => Box::new({
122-
let dir = tempfile::Builder::new().prefix("nh-os").tempdir()?;
123-
(dir.as_ref().join("result"), dir)
124-
}),
121+
None => match variant {
122+
BuildVm | Build => Box::new(PathBuf::from("result")),
123+
_ => Box::new({
124+
let dir = tempfile::Builder::new().prefix("nh-os").tempdir()?;
125+
(dir.as_ref().join("result"), dir)
126+
}),
127+
},
125128
};
126129

127130
debug!(?out_path);

0 commit comments

Comments
 (0)