radicale path updates and updatekey command

This commit is contained in:
steveej 2024-01-25 00:09:06 +01:00
parent ffdf25c117
commit d3024248d9
7 changed files with 179 additions and 9 deletions

View file

@ -0,0 +1,59 @@
# NOTE: please keep it in sync with .github pipelines
# NOTE: during testing make sure to change the branch below
# NOTE: before running the build-docker GH action edit
# build-docker.yml and change the release channel from :latest to :testing
# Builder image
FROM clojure:temurin-11-tools-deps-1.11.1.1208-bullseye-slim as builder
ARG DEBIAN_FRONTEND=noninteractive
# Install reqs
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
apt-transport-https \
gpg \
build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev \
zip
# install NodeJS & yarn
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | \
tee /etc/apt/trusted.gpg.d/yarn.gpg && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | \
tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y nodejs yarn
WORKDIR /data
ENV VERSION=0.10.5
# build Logseq static resources
RUN git clone -b ${VERSION} https://github.com/logseq/logseq.git .
RUN yarn config set network-timeout 240000 -g && yarn install
RUN yarn release-electron
RUN mkdir /out
RUN mv /data/static/out/make/zip /out/${VERSION}.zip
RUN mv /data/static/out/make/*.AppImage /out/
FROM scratch as artifacts
COPY --from=builder /out /
# Logseq-${VERSION}.AppImage
# RUN mv zip /${VERSION}.zip
# RUN \
# mkdir -p builds
# # NOTE: save VERSION file to builds directory
# cp static/VERSION ./builds/VERSION
# mv static/out/make/*-*.AppImage ./builds/Logseq-linux-aarch64-${VERSION}.AppImage
# mv static/out/make/zip/linux/x64/*-linux-x64-*.zip ./builds/Logseq-linux-aarch64-${VERSION}.zip
# # Web App Runner image
# FROM nginx:1.24.0-alpine3.17
#
# COPY --from=builder /data/static /usr/share/nginx/html
#

View file

@ -0,0 +1,6 @@
this is pseudocode that serves as a reminder
1. podman build -f Containerfile
2. podman unshare
3. podman mount $CONTAINER_ID
4. upload the AppImaeg

View file

@ -0,0 +1,80 @@
{ lib
, pname ? "logseq"
, version ? "0.10.5"
, src ? fetchurl {
url = "https://github.com/logseq/logseq/releases/download/${ version}/logseq-linux-x64-${ version}.AppImage";
hash = "sha256-F3YbqgvL04P0nXaIVkJlCq/z8hUE0M0UutkBs2omuBE=";
name = "${ pname}-${ version}.AppImage";
}
, stdenv
, fetchurl
, appimageTools
, makeWrapper
# graphs will not sync without matching upstream's major electron version
, electron_27
, git
, nix-update-script
}:
stdenv.mkDerivation
(finalAttrs:
let
inherit (finalAttrs) pname version src appimageContents;
in
{
inherit version pname src;
appimageContents = appimageTools.extract {
inherit pname src version;
};
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/${pname} $out/share/applications
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
cp -a ${appimageContents}/Logseq.desktop $out/share/applications/${pname}.desktop
# remove the `git` in `dugite` because we want the `git` in `nixpkgs`
chmod +w -R $out/share/${pname}/resources/app/node_modules/dugite/git
chmod +w $out/share/${pname}/resources/app/node_modules/dugite
rm -rf $out/share/${pname}/resources/app/node_modules/dugite/git
chmod -w $out/share/${pname}/resources/app/node_modules/dugite
mkdir -p $out/share/pixmaps
ln -s $out/share/${pname}/resources/app/icons/logseq.png $out/share/pixmaps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace Exec=Logseq Exec=${pname} \
--replace Icon=Logseq Icon=${pname}
runHook postInstall
'';
postFixup = ''
# set the env "LOCAL_GIT_DIRECTORY" for dugite so that we can use the git in nixpkgs
makeWrapper ${electron_27}/bin/electron $out/bin/${pname} \
--set "LOCAL_GIT_DIRECTORY" ${git} \
--add-flags $out/share/${pname}/resources/app \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}"
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "A local-first, non-linear, outliner notebook for organizing and sharing your personal knowledge base";
homepage = "https://github.com/logseq/logseq";
changelog = "https://github.com/logseq/logseq/releases/tag/${version}";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
})

18
nix/pkgs/logseq/flake.nix Normal file
View file

@ -0,0 +1,18 @@
{
inputs = {
utils.url = "github:numtide/flake-utils";
# clj2nix.url = "github:hlolli/clj2nix";
logseq.url = "github:logseq/logseq/0.5.9";
};
outputs = { nixpkgs, self, utils }: utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
# clj2nixBin = clj2nix.defaultPackage.${system};
in
{
packages = pkgs.callPackage ./default.nix { inherit self; };
nixpkgs = pkgs;
});
}