7b65fbe22c
- nix/package.nix: derivation for personal-backlog server + webapp
- nix/module.nix: NixOS module for services.personal-backlog
- Expose packages and nixosModules in flake.nix
Usage in NixOS configuration:
services.personal-backlog = {
enable = true;
port = 8080;
dataDir = "/var/lib/personal-backlog";
openFirewall = false;
};
43 lines
891 B
Nix
43 lines
891 B
Nix
{
|
|
lib,
|
|
stdenv,
|
|
python3,
|
|
makeWrapper,
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "personal-backlog";
|
|
version = "0.1.0";
|
|
|
|
src = ./..;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ python3 ];
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin $out/share/personal-backlog
|
|
|
|
cp server/server.py $out/share/personal-backlog/
|
|
cp -r webapp $out/share/personal-backlog/
|
|
|
|
makeWrapper ${python3}/bin/python3 $out/bin/personal-backlog \
|
|
--add-flags "$out/share/personal-backlog/server.py"
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A minimalist, single-user task manager where a Markdown file is your database";
|
|
homepage = "https://github.com/alfishe/personal-backlog";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
platforms = platforms.unix;
|
|
mainProgram = "personal-backlog";
|
|
};
|
|
}
|