pixivfe: move to ./pkgs

This commit is contained in:
Guanran Wang 2024-07-11 23:50:43 +08:00
parent 7a29d71c7f
commit 852b2df205
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
4 changed files with 24 additions and 16 deletions

View file

@ -1,7 +1,8 @@
{
modulesPath,
lib,
config,
inputs,
modulesPath,
pkgs,
...
}: {
@ -230,7 +231,7 @@
href = "https://element.ny4.dev/";
};
"PixivFE" = {
description = "Privacy respecting frontend for Pixiv";
description = getDesc inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.pixivfe;
href = "https://pixiv.ny4.dev";
};
"Uptime Kuma" = {

View file

@ -1,7 +1,8 @@
{
pkgs,
config,
lib,
config,
inputs,
pkgs,
...
}: let
cfg = config.services.pixivfe;
@ -9,10 +10,7 @@ in {
options.services.pixivfe = {
enable = lib.mkEnableOption "PixivFE, a privacy respecting frontend for Pixiv";
# package = lib.mkPackageOption pkgs "pixivfe" {};
package = lib.mkOption {
default = pkgs.callPackage ./pixivfe-pkg.nix {};
};
package = lib.mkPackageOption inputs.self.packages.${pkgs.stdenv.hostPlatform.system} "pixivfe" {};
openFirewall = lib.mkEnableOption "open ports in the firewall needed for the daemon to function";

View file

@ -1,13 +1,18 @@
# NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`,
# only keeping some packages that only fits for personal use.
pkgs: let
inherit (pkgs) lib;
inherit (pkgs) lib callPackage;
in {
# https://github.com/NixOS/nixpkgs/pull/308720
pixivfe = callPackage ./pixivfe.nix {};
scripts = lib.makeScope pkgs.newScope (self: let
inherit (self) callPackage;
in {
scripts = lib.makeScope pkgs.newScope (self: {
# util
makeScript = self.callPackage ./scripts/makeScript.nix {};
makeScript = callPackage ./scripts/makeScript.nix {};
# scripts
lofi = self.callPackage ./scripts/lofi.nix {};
lofi = callPackage ./scripts/lofi.nix {};
});
}

View file

@ -18,18 +18,22 @@ buildGoModule rec {
vendorHash = "sha256-QapDR964Tn+RxXdkGqCQXacdmlSapF841Y84n4d/6VI=";
ldflags = ["-s" "-w"];
ldflags = [
"-s"
"-w"
];
nativeBuildInputs = [makeBinaryWrapper];
# PixivFE require files from source code
postInstall = ''
mkdir -p $out/share/pixivfe
cp -r ./views/ $out/share/pixivfe/views
wrapProgram $out/bin/pixivfe \
--chdir ${src}
--chdir $out/share/pixivfe
'';
meta = {
description = "A privacy respecting frontend for Pixiv";
description = "Privacy respecting frontend for Pixiv";
homepage = "https://codeberg.org/VnPower/PixivFE";
license = lib.licenses.agpl3Only;
mainProgram = "pixivfe";