Initial commit: Lookbook personal collection app
Pinterest-like app for saving images, videos, quotes, and embeds. Features: - Go backend with PostgreSQL, SSR templates - Console-based admin auth (login/logout via browser console) - Item types: images, videos (ffmpeg transcoding), quotes, embeds - Media stored as BLOBs in PostgreSQL - OpenGraph metadata extraction for links - Embed detection for YouTube, Vimeo, Twitter/X - Masonry grid layout, item detail pages - Tag system with filtering - Refresh metadata endpoint with change warnings - Replace media endpoint for updating item images/videos
This commit is contained in:
commit
cdcc5b5293
45 changed files with 4634 additions and 0 deletions
90
default.nix
Normal file
90
default.nix
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
lookbook = pkgs.buildGoModule {
|
||||
pname = "lookbook";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
|
||||
vendorHash = null; # Update after first build
|
||||
|
||||
env.GOPRIVATE = "git.soup.land";
|
||||
|
||||
# Build the server binary
|
||||
subPackages = [ "cmd/server" ];
|
||||
|
||||
postInstall = ''
|
||||
mv $out/bin/server $out/bin/lookbook
|
||||
'';
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Lookbook";
|
||||
homepage = "https://git.soup.land/soup/lookbook";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
package = lookbook;
|
||||
|
||||
nixosModule = { config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.lookbook;
|
||||
in {
|
||||
options.services.lookbook = {
|
||||
enable = lib.mkEnableOption "lookbook service";
|
||||
|
||||
address = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "127.0.0.1:8080";
|
||||
description = "Address to listen on";
|
||||
};
|
||||
|
||||
databaseUrl = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "PostgreSQL connection URL";
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "lookbook";
|
||||
description = "User to run the service as";
|
||||
};
|
||||
|
||||
group = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "lookbook";
|
||||
description = "Group to run the service as";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users.${cfg.user} = {
|
||||
isSystemUser = true;
|
||||
group = cfg.group;
|
||||
};
|
||||
users.groups.${cfg.group} = {};
|
||||
|
||||
systemd.services.lookbook = {
|
||||
description = "Lookbook";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "postgresql.service" ];
|
||||
requires = [ "postgresql.service" ];
|
||||
|
||||
environment = {
|
||||
DATABASE_URL = cfg.databaseUrl;
|
||||
ADDR = cfg.address;
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
ExecStartPre = "${lookbook}/bin/lookbook -migrate";
|
||||
ExecStart = "${lookbook}/bin/lookbook web";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue