Skip to content

Commit

Permalink
dnote: init at 0.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot-wxt1221 committed Dec 20, 2024
1 parent 94cddaa commit a7ce60d
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions pkgs/by-name/dn/dnote/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
buildGoModule,
lib,
fetchFromGitHub,
fetchNpmDeps,
npmHooks,
nodejs,
}:

buildGoModule rec {
pname = "dnote";
version = "0.15.1";

src = fetchFromGitHub {
owner = "dnote";
repo = "dnote";
tag = "cli-v${version}";
hash = "sha256-2vVopuFf9bx8U3+U4wznC/9nlLtan+fU5v9HUCEI1R4=";
};

npmDeps = fetchNpmDeps {
inherit version src;
pname = "${pname}-webui";
sourceRoot = "${src.name}/pkg/server/assets";
hash = "sha256-gUr8ptPsE7uw/F52CZi1P2L7eLgGiELEz6tI+fwAN0I=";
};

overrideModAttrs = oldAttrs: {
# Do not add `npmConfigHook` to `goModules`
nativeBuildInputs = lib.remove npmHooks.npmConfigHook oldAttrs.nativeBuildInputs;
preBuild = null;
};

npmRoot = "pkg/server/assets";

nativeBuildInputs = [
npmHooks.npmConfigHook
nodejs
];

tags = [
"fts5"
];

preBuild = ''
patchShebangs .
pushd pkg/server/assets
./styles/build.sh
./js/build.sh
popd
'';

preCheck = ''
source ./pkg/server/.env.test
'';

ldflags = [
"-X github.com/dnote/dnote/pkg/server/buildinfo.Version=${version}"
"-X github.com/dnote/dnote/pkg/server/buildinfo.Standalone=true"
"-X github.com/dnote/dnote/pkg/server/buildinfo.JSFiles=main.js"
"-X github.com/dnote/dnote/pkg/server/buildinfo.CSSFiles=main.css"
];

postInstall = ''
mv $out/bin/cli $out/bin/dnote-cli
mv $out/bin/migrate $out/bin/dnote-migrate
mv $out/bin/server $out/bin/dnote-server
mv $out/bin/templates $out/bin/dnote-templates
mv $out/bin/watcher $out/bin/dnote-watcher
'';

checkFlags = [
"-p 1"
];

vendorHash = "sha256-4mP5z3ZVlHYhItRjkbXvcOxVm6PuZ6viL2GHqzCH9tA=";

meta = {
homepage = "https://www.getdnote.com/";
description = "Simple command line notebook for programmers";
changelog = "https://github.com/dnote/dnote/blob/master/CHANGELOG.md";
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ bot-wxt1221 ];
license = with lib.licenses; [
gpl3Only
agpl3Only
];
};
}

0 comments on commit a7ce60d

Please sign in to comment.