removed shoko

This commit is contained in:
baritone 2025-03-18 12:46:49 +01:00
parent a4741ba6a3
commit 17ae370581
2 changed files with 0 additions and 126 deletions

View file

@ -1,44 +0,0 @@
{
lib,
dotnetCorePackages,
buildDotnetModule,
pkgs,
fetchFromGitHub,
...
}:
buildDotnetModule rec {
pname = "shoko-${version}";
version = "5.1.0";
src = fetchFromGitHub {
owner = "ShokoAnime";
repo = "ShokoServer";
rev = "v5.1.0";
hash = "";
};
projectFile = "Shoko.CLI/Shoko.CLI.csproj";
executables = ["shoko"];
# nugetDeps = ./nuget-deps.json;
runtimeDeps = with pkgs; [
mediainfo
rhash
];
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;
dotnetBuildFlags = ["--no-self-contained"];
# makeWrapperArgs = [];
meta = with lib; {
description = "Shoko server for self hosted anime browsing";
homepage = "https://shokoanime.com/";
license = licenses.mit;
maintainers = with maintainers; [
# TODO: Add myself to maintainers
me
];
mainProgram = "shoko";
platforms = dotnet-runtime.meta.platforms;
};
}

View file

@ -1,82 +0,0 @@
{
config,
pkgs,
lib ? pkgs.lib,
callPackage,
...
}: let
cfg = config.services.shoko;
in {
options = {
services.shoko = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable Shoko server.";
};
host = lib.mkOption {
type = lib.types.str;
default = "*";
example = "localhost";
description = ''
The hostname or address to listen on or <literal>*</literal> to listen
on all interfaces.
'';
};
port = lib.mkOption {
type = lib.types.int;
default = 3000;
description = ''
TCP port the web server should listen to.
'';
};
baseDir = lib.mkOption {
type = lib.types.string;
default = "/var/lib/shoko";
description = ''
The folder shoko will dump its shit into
'';
};
};
};
config = lib.mkIf cfg.enable {
users.extraGroups.shoko = {};
users.extraUsers.shoko = {
description = "Shoko";
group = "shoko";
createHome = true;
home = cfg.baseDir;
useDefaultShell = true;
};
};
systemd.services.shoko-init = {
wantedBy = ["multi-user.target"];
# TODO: Check if shoko requires a db
# requires = optional haveLocalDB "postgresql.service";
# after = optional haveLocalDB "postgresql.service";
preStart = ''
mkdir -p ${cfg.baseDir}
chown shoko.shoko ${cfg.baseDir}
chmod 0750 ${cfg.baseDir}
# the rest
'';
};
systemd.services.shoko-server = {
wantedBy = ["multi-user.target"];
requires = ["shoko-init.service"];
after = ["shoko-init.service"];
serviceConfig = {
ExecStart = "${callPackage ./package.nix}/bin/shoko";
User = "shoko";
PermissionsStartOnly = true;
Restart = "always";
};
};
}