chore: initial commit
This commit is contained in:
commit
6df9526df9
6 changed files with 2346 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Ignore the Nix compilation artifact
|
||||
result
|
46
cli.nix
Normal file
46
cli.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
buildDotnetModule,
|
||||
dotnetCorePackages,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
mediainfo,
|
||||
rhash,
|
||||
}:
|
||||
|
||||
buildDotnetModule rec {
|
||||
pname = "shoko-cli";
|
||||
version = "0-unstable-2025-01-10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ShokoAnime";
|
||||
repo = "ShokoServer";
|
||||
rev = "252cb62591e56f4dc4a717722de0d87ba9dbf715";
|
||||
hash = "sha256-Mzm2DTZg5L/mVFL5mEku1R+9p4SP769tUPmU/1gJS3k=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
projectFile = "Shoko.CLI/Shoko.CLI.csproj";
|
||||
executables = [ "Shoko.CLI" ];
|
||||
nugetDeps = ./deps.json;
|
||||
runtimeDeps = [
|
||||
mediainfo
|
||||
rhash
|
||||
];
|
||||
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
||||
dotnet-runtime = dotnetCorePackages.sdk_8_0;
|
||||
dotnetBuildFlags = [
|
||||
"--no-self-contained"
|
||||
"/p:Version=\"5.0.0.0\""
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "The All-in-One Cross-Platform Anime Management System Built For You";
|
||||
homepage = "https://shokoanime.com/";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [
|
||||
wizardlink
|
||||
];
|
||||
mainProgram = "Shoko.CLI";
|
||||
platforms = dotnet-runtime.meta.platforms;
|
||||
};
|
||||
}
|
28
configuration.nix
Normal file
28
configuration.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, pkgs }:
|
||||
|
||||
with pkgs.lib;
|
||||
{
|
||||
options.services.shoko-cli = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
example = false;
|
||||
description = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
systemd.services.shoko-cli = mkIf config.services.shoko-cli.enable {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
unitConfig = {
|
||||
Description = "The All-in-One Cross-Platform Anime Management System Built For You";
|
||||
After = [ "network-online.target" ];
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.callPackage ./cli.nix { }}/bin/Shoko.CLI";
|
||||
Restart = "always";
|
||||
Type = "simple";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
57
flake.lock
generated
Normal file
57
flake.lock
generated
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 0,
|
||||
"narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=",
|
||||
"path": "/nix/store/v0g0bxsd5gw6k0jz2855f8h7l1218925-source",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"utils": "utils"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
26
flake.nix
Normal file
26
flake.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
inputs = {
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
}:
|
||||
utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
default = pkgs.callPackage ./cli.nix { };
|
||||
};
|
||||
|
||||
nixosModules = {
|
||||
default = import ./configuration.nix;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue