add archivebox

This commit is contained in:
Anish Lakhwara 2022-12-14 00:54:06 +10:00
parent d0f036c466
commit 1be9f5ff9e
4 changed files with 65 additions and 5 deletions

View file

@ -312,11 +312,11 @@
"vimwiki-cli": "vimwiki-cli" "vimwiki-cli": "vimwiki-cli"
}, },
"locked": { "locked": {
"lastModified": 1670394895, "lastModified": 1670936403,
"narHash": "sha256-MlkPVWWHcUPzNYRiJ+32vQL7iVS+aswGECxL8bUE5xM=", "narHash": "sha256-alrM0QG1eXYJTjgQ/4Ahmw95FZ435cIHXwDNdq/mLUM=",
"ref": "main", "ref": "main",
"rev": "9730a8abbde76aa409f39a1f5128744d4e191cad", "rev": "3c9d0c5471affee1b426a0159b13201df41cad6c",
"revCount": 447, "revCount": 455,
"type": "git", "type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
}, },

View file

@ -18,6 +18,7 @@
../profiles/calibre ../profiles/calibre
../profiles/wallabag ../profiles/wallabag
../profiles/finance ../profiles/finance
../profiles/archivebox
]; ];
# For some reason this doesn't work in the profile, but does over here?? # For some reason this doesn't work in the profile, but does over here??

View file

@ -72,7 +72,7 @@
mossnet.backup = { mossnet.backup = {
enable = true; enable = true;
name = "curve"; name = "curve";
paths = [ "/home/anish" ]; paths = [ "/home/anish/usr" ];
}; };
# enable adb # enable adb

View file

@ -0,0 +1,59 @@
{ config, options, lib, pkgs, ... }:
with lib;
let
# cfg = config.services.archivebox;
dataDir = "/var/lib/archivebox";
user = "archivebox";
port = "8123";
in
{
systemd.services.archivebox-install = {
description = "archivebox install service";
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ coreutils archivebox ];
serviceConfig = {
User = user;
Type = "oneshot";
RemainAfterExit = "yes";
PermissionsStartOnly = true;
};
preStart = ''
mkdir -p "${dataDir}"
chown ${user} "${dataDir}"
'';
script = ''
echo "Setting up wallabag files in ${dataDir} ..."
cd "${dataDir}"
archivebox init
'';
};
systemd.services.archivebox-server = {
description = "archivebox server service";
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ coreutils archivebox ];
serviceConfig = {
User = user;
Type = "oneshot";
RemainAfterExit = "yes";
PermissionsStartOnly = true;
};
preStart = ''
mkdir -p "${dataDir}"
chown ${user} "${dataDir}"
'';
script = ''
echo "Setting up wallabag files in ${dataDir} ..."
cd "${dataDir}"
archivebox server 0.0.0.0:${port}
'';
};
}