Skip to content

Commit bcd41b6

Browse files
committed
pkgs/Profpatsch/nman: allow any absolute or relative paths for -f
This should pass the right kinds of path to nix in most situations.
1 parent 3b1820e commit bcd41b6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pkgs/profpatsch/nman/nman.1

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ Use the specified .nix file
9393
instead of
9494
.Ql <nixpkgs>
9595
from the Nix search path. This allows using local package definitions
96-
or custom package sets. Use
97-
.Dq .\&
98-
to refer to
99-
.Pa ./default.nix
100-
in the current directory.
96+
or custom package sets.
10197
.El
10298

10399
.Sh EXAMPLES

pkgs/profpatsch/nman/nman.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,12 @@ impl Main {
342342
let tmpdir = TempDir::new("nman").map_err(NmanError::IO)?;
343343
let nix_import = match &self.file_path {
344344
Some(path) => {
345-
if path == "." {
346-
"./default.nix".to_string()
345+
if path.starts_with('/') {
346+
// Absolute path - strip trailing slashes
347+
path.trim_end_matches('/').to_string()
347348
} else {
348-
path.clone()
349+
// Relative path - prepend ./
350+
format!("./{}", path)
349351
}
350352
},
351353
None => "<nixpkgs>".to_string(),

0 commit comments

Comments
 (0)