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]]
|
[[package]]
|
||||||
name = "pxiv"
|
name = "fxpixiv"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"json",
|
"json",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pxiv"
|
name = "fxpixiv"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# pxiv
|
# fxpixiv
|
||||||
|
|
||||||
The pixiv embed fixer
|
The pixiv embed fixer
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, lib, rustPlatform }:
|
{ pkgs, lib, rustPlatform }:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "pxiv";
|
pname = "fxpixiv";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
# pxiv.service.nix
|
# fxpixiv.service.nix
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption mkIf types;
|
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
|
in
|
||||||
{
|
{
|
||||||
options.services.pxiv = {
|
options.services.fxpixiv = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Enable the pxiv embed helper service.";
|
description = "Enable the fxpixiv embed helper service.";
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 8000;
|
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 {
|
config = mkIf config.services.fxpixiv.enable {
|
||||||
systemd.services.pxiv = {
|
systemd.services.fxpixiv = {
|
||||||
description = "pxiv embed helper service";
|
description = "fxpixiv embed helper service";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
# Command to start the Rocket application
|
# Command to start the Rocket application
|
||||||
serviceConfig.ExecStart = "${pxivApp}/bin/pxiv";
|
serviceConfig.ExecStart = "${fxpixivApp}/bin/fxpixiv";
|
||||||
|
|
||||||
# Set the port environment variable
|
# 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
|
# Restart on failure
|
||||||
serviceConfig.Restart = "always";
|
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));
|
meta http-equiv="Refresh" content=(format!("0; url='{}'", source));
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
h1 { "pxiv.net" }
|
h1 { "fxpixiv.net" }
|
||||||
h2 { "your (not yet so) friendly pixiv embed helper" }
|
h2 { "your (not yet so) friendly pixiv embed helper" }
|
||||||
p { "This page will take you to the original one one pixiv - if not, "}
|
p { "This page will take you to the original one one pixiv - if not, "}
|
||||||
a href=(source) { "refresh manually" }
|
a href=(source) { "refresh manually" }
|
||||||
|
|
Loading…
Add table
Reference in a new issue