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
bashdb: init at 4.4-0.92 #22275
bashdb: init at 4.4-0.92 #22275
Conversation
name = "bashdb-4.4-0.92"; | ||
|
||
src = fetchurl { | ||
url = "mirror://sourceforge/sourceforge/bashdb/bashdb-4.4-0.92.tar.bz2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using mirror://sourceforge/bashdb
(instead of sourceforge/sourceforge/bashdb
)
Also, consider re-using name
(or factoring out a version
attr) in src.url
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestions! I'll give them a try,
@@ -1,10 +1,15 @@ | |||
{ stdenv, fetchurl }: | |||
|
|||
let | |||
basename = "bashdb-4.4-0.92"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you make the attrset passed to mkDerivation
recursive, you can inline this, as in
stdenv.mkDerivation rec {
name = "...";
src = {
url = ".../${name}.tar.bz2";
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really! I did not know that. So, by adding the rec
keyword, attributes can refer to other attributes within the same set? Are there any drawbacks to using the rec
keyword, or is it to be preferred over the let
version that I first wrote?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For very complicated stuff it may be clearer to use explicit recursion (to not lose track of what is being referred to exactly), but it's almost always better to use rec
if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then I know. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rec { foo = "x"; bar = foo; }
basically desugars to
let self = { foo = "x"; bar = self.foo; }; in self
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. That makes it a lot clearer; thanks for explaining!
Thank you |
Motivation for this change
To introduce the Bash script debugger.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)