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
nb: init at 5.7.8 #110962
nb: init at 5.7.8 #110962
Conversation
sha256 = "1sw09sgskzsn3dy4ipvl52hwh5k3cwqfhjnm7rmxbzcpfk3jm3sp"; | ||
}; | ||
|
||
buildInputs = [ bash git ]; |
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.
How is git used here? If it is used to extract version or commit information from the repository this would require patching.
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.
The script uses git to synchronize your notes. So at runtime, not buildtime.
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.
Shouldn't makeWrapper be used for such things?
I marked this as stale due to inactivity. → More info |
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.
Are you gonna finish this? I would like to test this program.
, bash, git | ||
}: | ||
stdenv.mkDerivation rec { | ||
version = "5.7.8"; |
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.
version = "5.7.8"; | |
version = "6.10.1"; |
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.
I don't currently have time to. The script is enormous and somewhat messy and this interacts poorly with wrapping. I'm mostly hoping resholve becomes advanced enough to deal with it automatically.
{ stdenv, lib, fetchFromGitHub, installShellFiles | ||
, bash, git | ||
}: | ||
stdenv.mkDerivation rec { | ||
version = "5.7.8"; | ||
pname = "nb"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "xwmx"; | ||
repo = "nb"; | ||
rev = version; | ||
sha256 = "1sw09sgskzsn3dy4ipvl52hwh5k3cwqfhjnm7rmxbzcpfk3jm3sp"; | ||
}; | ||
|
||
buildInputs = [ bash git ]; | ||
nativeBuildInputs = [ installShellFiles ]; | ||
|
||
dontBuild = true; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin/ | ||
mv nb $out/bin/ | ||
mv bin/bookmark $out/bin/ | ||
|
||
runHook postInstall | ||
''; | ||
|
||
postInstall = '' | ||
installShellCompletion etc/nb-completion.{bash,zsh} | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A command line note-taking, bookmarking, archiving, and knowledge base application"; | ||
longDescription = '' | ||
`nb` creates notes in text-based formats like Markdown, Emacs Org mode, | ||
and LaTeX, can work with files in any format, can import and export notes | ||
to many document formats, and can create private, password-protected | ||
encrypted notes and bookmarks. With `nb`, you can write notes using Vim, | ||
Emacs, VS Code, Sublime Text, and any other text editor you like. `nb` | ||
works in any standard Linux / Unix environment, including macOS and | ||
Windows via WSL. Optional dependencies can be installed to enhance | ||
functionality, but `nb` works great without them. | ||
|
||
`nb` is also a powerful text-based CLI bookmarking system. Page | ||
information is automatically downloaded, compiled, and saved into normal | ||
Markdown documents made for humans, so bookmarks are easy to edit just | ||
like any other note. | ||
|
||
`nb` uses Git in the background to automatically record changes and sync | ||
notebooks with remote repositories. `nb` can also be configured to sync | ||
notebooks using a general purpose syncing utility like Dropbox so notes | ||
can be edited in other apps on any device. | ||
|
||
`nb` is designed to be portable, future-focused, and vendor independent, | ||
providing a full-featured and intuitive experience within a highly | ||
composable user-centric text interface. The entire program is a single | ||
well-tested shell script that can be installed, copied, or curled almost | ||
anywhere and just work, using progressive enhancement for various | ||
experience improvements in more capable environments. `nb` works great | ||
whether you have one notebook with just a few notes or dozens of | ||
notebooks containing thousands of notes, bookmarks, and other items. `nb` | ||
makes it easy to incorporate other tools, writing apps, and workflows. | ||
`nb` can be used a little, a lot, once in a while, or for just a subset | ||
of features. `nb` is flexible. | ||
''; | ||
homepage = "https://xwmx.github.io/nb/"; | ||
license = licenses.agpl3Plus; | ||
maintainers = [ maintainers.toonn ]; | ||
platforms = platforms.all; | ||
}; | ||
} |
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.
{ stdenv, lib, fetchFromGitHub, installShellFiles | |
, bash, git | |
}: | |
stdenv.mkDerivation rec { | |
version = "5.7.8"; | |
pname = "nb"; | |
src = fetchFromGitHub { | |
owner = "xwmx"; | |
repo = "nb"; | |
rev = version; | |
sha256 = "1sw09sgskzsn3dy4ipvl52hwh5k3cwqfhjnm7rmxbzcpfk3jm3sp"; | |
}; | |
buildInputs = [ bash git ]; | |
nativeBuildInputs = [ installShellFiles ]; | |
dontBuild = true; | |
installPhase = '' | |
mkdir -p $out/bin/ | |
mv nb $out/bin/ | |
mv bin/bookmark $out/bin/ | |
runHook postInstall | |
''; | |
postInstall = '' | |
installShellCompletion etc/nb-completion.{bash,zsh} | |
''; | |
meta = with lib; { | |
description = "A command line note-taking, bookmarking, archiving, and knowledge base application"; | |
longDescription = '' | |
`nb` creates notes in text-based formats like Markdown, Emacs Org mode, | |
and LaTeX, can work with files in any format, can import and export notes | |
to many document formats, and can create private, password-protected | |
encrypted notes and bookmarks. With `nb`, you can write notes using Vim, | |
Emacs, VS Code, Sublime Text, and any other text editor you like. `nb` | |
works in any standard Linux / Unix environment, including macOS and | |
Windows via WSL. Optional dependencies can be installed to enhance | |
functionality, but `nb` works great without them. | |
`nb` is also a powerful text-based CLI bookmarking system. Page | |
information is automatically downloaded, compiled, and saved into normal | |
Markdown documents made for humans, so bookmarks are easy to edit just | |
like any other note. | |
`nb` uses Git in the background to automatically record changes and sync | |
notebooks with remote repositories. `nb` can also be configured to sync | |
notebooks using a general purpose syncing utility like Dropbox so notes | |
can be edited in other apps on any device. | |
`nb` is designed to be portable, future-focused, and vendor independent, | |
providing a full-featured and intuitive experience within a highly | |
composable user-centric text interface. The entire program is a single | |
well-tested shell script that can be installed, copied, or curled almost | |
anywhere and just work, using progressive enhancement for various | |
experience improvements in more capable environments. `nb` works great | |
whether you have one notebook with just a few notes or dozens of | |
notebooks containing thousands of notes, bookmarks, and other items. `nb` | |
makes it easy to incorporate other tools, writing apps, and workflows. | |
`nb` can be used a little, a lot, once in a while, or for just a subset | |
of features. `nb` is flexible. | |
''; | |
homepage = "https://xwmx.github.io/nb/"; | |
license = licenses.agpl3Plus; | |
maintainers = [ maintainers.toonn ]; | |
platforms = platforms.all; | |
}; | |
} | |
{ stdenv | |
, lib | |
, fetchFromGitHub | |
, makeWrapper | |
, installShellFiles | |
, bash | |
, git | |
}: | |
stdenv.mkDerivation rec { | |
version = "6.10.2"; | |
pname = "nb"; | |
src = fetchFromGitHub { | |
owner = "xwmx"; | |
repo = "nb"; | |
rev = version; | |
sha256 = "sha256-n87NT+qzBq8J1n0aT2Di7iBEN9inDWXAb8c7Qd2y0TA="; | |
}; | |
nativeBuildInputs = [ makeWrapper installShellFiles ]; | |
dontBuild = true; | |
postPatch = '' | |
patchShebangs ./nb ./bin/bookmark | |
''; | |
installPhase = '' | |
mkdir -p $out/bin | |
mv nb $out/bin/ | |
mv bin/bookmark $out/bin/ | |
wrapProgram $out/bin/nb --prefix PATH : "${lib.makeBinPath [ | |
bash | |
git | |
]}" | |
runHook postInstall | |
''; | |
postInstall = '' | |
installShellCompletion etc/nb-completion.{bash,zsh} | |
''; | |
meta = with lib; { | |
description = "A command line note-taking, bookmarking, archiving, and knowledge base application"; | |
longDescription = '' | |
`nb` creates notes in text-based formats like Markdown, Emacs Org mode, | |
and LaTeX, can work with files in any format, can import and export notes | |
to many document formats, and can create private, password-protected | |
encrypted notes and bookmarks. With `nb`, you can write notes using Vim, | |
Emacs, VS Code, Sublime Text, and any other text editor you like. `nb` | |
works in any standard Linux / Unix environment, including macOS and | |
Windows via WSL. Optional dependencies can be installed to enhance | |
functionality, but `nb` works great without them. | |
`nb` is also a powerful text-based CLI bookmarking system. Page | |
information is automatically downloaded, compiled, and saved into normal | |
Markdown documents made for humans, so bookmarks are easy to edit just | |
like any other note. | |
`nb` uses Git in the background to automatically record changes and sync | |
notebooks with remote repositories. `nb` can also be configured to sync | |
notebooks using a general purpose syncing utility like Dropbox so notes | |
can be edited in other apps on any device. | |
`nb` is designed to be portable, future-focused, and vendor independent, | |
providing a full-featured and intuitive experience within a highly | |
composable user-centric text interface. The entire program is a single | |
well-tested shell script that can be installed, copied, or curled almost | |
anywhere and just work, using progressive enhancement for various | |
experience improvements in more capable environments. `nb` works great | |
whether you have one notebook with just a few notes or dozens of | |
notebooks containing thousands of notes, bookmarks, and other items. `nb` | |
makes it easy to incorporate other tools, writing apps, and workflows. | |
`nb` can be used a little, a lot, once in a while, or for just a subset | |
of features. `nb` is flexible. | |
''; | |
homepage = "https://xwmx.github.io/nb/"; | |
license = licenses.agpl3Plus; | |
maintainers = with maintainers; [ toonn ]; | |
platforms = platforms.all; | |
}; | |
} |
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.
I tried to make the wrapProgram function work for both nb and bookmark with a for statement but that didn't work. Is there another way than just cloning it for bookmark?
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.
Also, should be optional dependencies be included here or not?
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.
Do we need to wrap it separately? I think you can invoke it as a subcommand and it's a pretty generic name to claim.
I'm not really sure about the optional deps. They were atrociously badly documented when I last looked into this, most weren't actually mentioned anywhere in the docs. They're not build-time dependencies and nb
simply picks them up from the environment if they're present so I don't think we should burden ourselves maintaining a potentially volatile list of deps.
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.
I removed the optional deps.
You also need to add an entry in |
Co-authored-by: papojari <papojari-git.ovoid@aleeas.com>
Ah, unfortunate that this was merged. I had picked this back up, figured there was no rush since it's been so long anyway. The current state of the package means it's pretty much unusable. It's a very annoying script to package because it's supposed to pick things up from the |
Then we must patch the source code so that it doesn't display |
That's an option but also a moving target. I was hoping we could find a way to wrap it such that that's not necessary. I think we could simply embed the |
Motivation for this change
Seemed like an interesting note-taking application to package.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)