GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Moku/flake.nix at main · LeafGithub/Moku

Expand file tree

/

flake.nix

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
172 lines (152 loc) · 6.19 KB
/

flake.nix

Copy path

File metadata and controls

172 lines (152 loc) · 6.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
{
description = "Moku — manga/novel/anime reader frontend for Tsunagu";
nixConfig = {
extra-substituters = [ "https://moku.cachix.org" ];
extra-trusted-public-keys = [ "moku.cachix.org-1:EnMXp6/uQVI6IRbKW0xEQylSYoV2N4vszOsoW6/Pq1s=" ];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
# The backend. `nix run .#moku` launches this via the TSUNAGU_BIN env var
# (see nix/moku.nix + src-tauri/src/backend.rs) instead of a bundled sidecar.
# Tracks the default branch; `nix flake update tsunagu` pulls the latest commit.
tsunagu = {
url = "github:moku-project/Tsunagu";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ flake-parts, rust-overlay, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem =
{ system, lib, ... }:
let
versions = import ./nix/versions.nix;
version = versions.moku;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer"
];
};
# WebKitGTK plays <video>/<audio> through GStreamer 1.0 — without
# these plugins it fails silently ("GStreamer element appsink not
# found", grey video). libav covers h264/aac (mp4); good/bad/ugly
# cover demuxers, sinks (autoaudiosink) and misc codecs.
gstPlugins = with pkgs.gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
gst-libav
];
runtimeLibs = (with pkgs; [
webkitgtk_4_1
gtk3
glib
glib-networking # GIO TLS backend — without it the webview can't
# fetch external https:// resources (AniList covers)
cairo
pango
atk
gdk-pixbuf
libsoup_3
openssl
dbus
libappindicator-gtk3
gsettings-desktop-schemas
]) ++ gstPlugins;
gstPluginPath = pkgs.lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" gstPlugins;
src = lib.cleanSourceWith {
src = ./.;
filter =
path: type:
let
base = builtins.baseNameOf path;
in
(lib.hasInfix "/src" path)
|| (lib.hasInfix "/src-tauri/src" path)
|| (lib.hasInfix "/src-tauri/icons" path)
|| (lib.hasInfix "/src-tauri/capabilities" path)
|| (lib.hasInfix "/static" path)
|| base == "index.html"
|| base == "package.json"
|| base == "pnpm-lock.yaml"
|| base == "pnpm-workspace.yaml"
|| base == "tsconfig.json"
|| base == "vite.config.ts"
|| base == "svelte.config.js"
|| base == "Cargo.toml"
|| base == "Cargo.lock"
|| base == "build.rs"
|| base == "tauri.conf.json";
};
tsunaguBin = "${inputs.tsunagu.packages.${system}.default}/bin/tsunagu";
moku = pkgs.callPackage ./nix/moku.nix {
inherit lib pkgs rustToolchain runtimeLibs version src versions gstPluginPath tsunaguBin;
appIcon = ./src/lib/assets/moku-icon.svg;
};
scripts = import ./nix/scripts.nix { inherit pkgs rustToolchain version versions; };
in
{
packages = {
inherit moku;
default = moku;
};
apps = {
default = { type = "app"; program = "${moku}/bin/moku"; };
moku = { type = "app"; program = "${moku}/bin/moku"; };
bump = { type = "app"; program = "${scripts.bump}/bin/moku-bump"; };
tunnel = { type = "app"; program = "${scripts.tunnel}/bin/moku-tunnel"; };
};
devShells.default = pkgs.mkShell {
buildInputs = runtimeLibs;
nativeBuildInputs = with pkgs; [
rustToolchain
pkg-config
wrapGAppsHook3
nodejs_22
pnpm
cloudflared
xdg-utils
(python3.withPackages (ps: [
ps.aiohttp
ps.tomlkit
]))
];
shellHook = ''
export NO_STRIP=true
export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}''${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath runtimeLibs}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export GST_PLUGIN_SYSTEM_PATH_1_0="${gstPluginPath}''${GST_PLUGIN_SYSTEM_PATH_1_0:+:$GST_PLUGIN_SYSTEM_PATH_1_0}"
export GIO_EXTRA_MODULES="${pkgs.glib-networking}/lib/gio/modules''${GIO_EXTRA_MODULES:+:$GIO_EXTRA_MODULES}"
# Same launch path as `nix run .#moku`: backend.rs picks up
# TSUNAGU_BIN and spawns this exact server (with its matching jar +
# JRE). Tracks the `tsunagu` flake input — `nix flake update
# tsunagu` + re-enter the shell to move it.
export TSUNAGU_BIN="${tsunaguBin}"
echo "Moku dev shell — pnpm install && pnpm tauri:dev"
echo ""
echo " backend: ${tsunaguBin}"
echo " nix run .#bump -- <ver> bump version + rebuild frontend"
echo " nix run .#tunnel -- [port] expose local server via cloudflare"
'';
};
formatter = pkgs.nixfmt-rfc-style;
};
};
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.