rename project
This commit is contained in:
parent
93cbd88757
commit
e8eced61a5
6 changed files with 15 additions and 15 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1318,7 +1318,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "pxiv"
|
||||
name = "fxpixiv"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"json",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "pxiv"
|
||||
name = "fxpixiv"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# pxiv
|
||||
# fxpixiv
|
||||
|
||||
The pixiv embed fixer
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ pkgs, lib, rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "pxiv";
|
||||
pname = "fxpixiv";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
# pxiv.service.nix
|
||||
# fxpixiv.service.nix
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption mkIf types;
|
||||
pxivApp = import ./default.nix { inherit pkgs lib; rustPlatform = pkgs.rustPlatform; };
|
||||
fxpixivApp = import ./default.nix { inherit pkgs lib; rustPlatform = pkgs.rustPlatform; };
|
||||
in
|
||||
{
|
||||
options.services.pxiv = {
|
||||
options.services.fxpixiv = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable the pxiv embed helper service.";
|
||||
description = "Enable the fxpixiv embed helper service.";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 8000;
|
||||
description = "Port on which the pxiv embed helper listens.";
|
||||
description = "Port on which the fxpixiv embed helper listens.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.services.pxiv.enable {
|
||||
systemd.services.pxiv = {
|
||||
description = "pxiv embed helper service";
|
||||
config = mkIf config.services.fxpixiv.enable {
|
||||
systemd.services.fxpixiv = {
|
||||
description = "fxpixiv embed helper service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
# Command to start the Rocket application
|
||||
serviceConfig.ExecStart = "${pxivApp}/bin/pxiv";
|
||||
serviceConfig.ExecStart = "${fxpixivApp}/bin/fxpixiv";
|
||||
|
||||
# Set the port environment variable
|
||||
serviceConfig.Environment = [ "ROCKET_PORT=${toString config.services.pxiv.port}" ];
|
||||
serviceConfig.Environment = [ "ROCKET_PORT=${toString config.services.fxpixiv.port}" ];
|
||||
|
||||
# Restart on failure
|
||||
serviceConfig.Restart = "always";
|
|
@ -95,7 +95,7 @@ async fn create_page(source: &String, html: &String) -> Result<String, Status> {
|
|||
meta http-equiv="Refresh" content=(format!("0; url='{}'", source));
|
||||
}
|
||||
body {
|
||||
h1 { "pxiv.net" }
|
||||
h1 { "fxpixiv.net" }
|
||||
h2 { "your (not yet so) friendly pixiv embed helper" }
|
||||
p { "This page will take you to the original one one pixiv - if not, "}
|
||||
a href=(source) { "refresh manually" }
|
||||
|
|
Loading…
Add table
Reference in a new issue