-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{shoko-webui,shoko,nixos/shoko}: init #350065
base: master
Are you sure you want to change the base?
Conversation
The formatting check fails for the generated dependencies file, which I don't believe should be formatted. |
e68ce8a
to
001d025
Compare
fdc24a7
to
9df8fbd
Compare
cc @NixOS/nix-formatting, the |
To be fair, I like its formatting way more. But I guess it should be formatted then? |
For the nuget thing: what about: diff --git a/pkgs/build-support/dotnet/add-nuget-deps/default.nix b/pkgs/build-support/dotnet/add-nuget-deps/default.nix
index bf3df815af8a..12810e092d03 100644
--- a/pkgs/build-support/dotnet/add-nuget-deps/default.nix
+++ b/pkgs/build-support/dotnet/add-nuget-deps/default.nix
@@ -8,6 +8,7 @@
cacert,
fetchNupkg,
callPackage,
+ nixfmt-rfc-style,
}:
{
@@ -67,6 +68,7 @@ attrs
isExecutable = true;
inherit cacert;
nugetToNix = nuget-to-nix;
+ nixfmt = nixfmt-rfc-style;
};
defaultDepsFile =
diff --git a/pkgs/build-support/dotnet/add-nuget-deps/fetch-deps.sh b/pkgs/build-support/dotnet/add-nuget-deps/fetch-deps.sh
index af560b96fcd5..47731b29cd59 100644
--- a/pkgs/build-support/dotnet/add-nuget-deps/fetch-deps.sh
+++ b/pkgs/build-support/dotnet/add-nuget-deps/fetch-deps.sh
@@ -7,5 +7,6 @@ genericBuild
@nugetToNix@/bin/nuget-to-nix "${NUGET_PACKAGES%/}"
) > deps.nix
+@nixfmt@/bin/nixfmt deps.nix
mv deps.nix "$1"
echo "Succesfully wrote lockfile to $1" |
66bd84d
to
92f26e3
Compare
The nuget formatting thing isn't in the scope of this PR. Although it would be better to generate formatted code, instead of formatting it after. |
Sorry, that was unclear. I was suggesting that solution to the formatting team you pinged, not to you for this very PR ;) |
Just a note that you will need to provide your own tmdb api key in the setting when building from source outside our CD pipeline, and the version number and release channel are currently not set while building the binary in this patch set. See the dockerfile in the server repo, or the GH action(s) in the server repo for how to include them, if desired. |
7fda3f2
to
0b92f16
Compare
The test fails because Shoko is trying to access its settings file ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nixosTests.shoko
is hanging, the relevant error there:
The server failed to start: System.UnauthorizedAccessException: Access to the path '/var/lib/shoko/settings-server.json' is denied.
Also adding an update script would be nice, for the webui package passthru.updateSript = nix-update-script { };
should be sufficient, the shoko package uses dotnet which doesn't have a clean solution yet, but this should work:
passthru.updateScript = _experimental-update-script-combinators.sequence [
(gitUpdater { }).command
(finalAttrs.passthru.fetch-deps)
];
That should be most of the stuff, except
|
Updated to 5.1.0 and 2.2.0 |
Explanation of how can you debug itThis could be useful to run commands in the VM without having to rebuild it every time: https://wiki.nixos.org/wiki/NixOS_VM_tests#Connecting_to_an_interactive_VM_via_SSH Inside the VM, the shoko service throws [root@machine:~]# find -L /var/lib/shoko
/var/lib/shoko
/var/lib/shoko/webui
/var/lib/shoko/webui/favicon.ico
/var/lib/shoko/webui/version.json
/var/lib/shoko/webui/assets
/var/lib/shoko/webui/assets/sora-latin-100-normal-wz_LKC25.woff2
/var/lib/shoko/webui/assets/sora-latin-400-normal-DZtuNFrm.woff2
/var/lib/shoko/webui/assets/sora-latin-200-normal-CSO-6fll.woff2
/var/lib/shoko/webui/assets/sora-latin-500-normal-D6ntt6OU.woff2
/var/lib/shoko/webui/assets/sora-latin-300-normal-sH7t8am-.woff2
/var/lib/shoko/webui/assets/sora-latin-600-normal-C1m6bnBo.woff2
/var/lib/shoko/webui/assets/sora-latin-700-normal-CcRYJWjj.woff2
/var/lib/shoko/webui/assets/sora-latin-800-normal-B4rKiZhk.woff2
/var/lib/shoko/webui/assets/OnePiece-CCVDVjBa.png
/var/lib/shoko/webui/assets/sora-latin-100-normal-Db8iwt7l.woff
/var/lib/shoko/webui/assets/sora-latin-200-normal-E31gOQMh.woff
/var/lib/shoko/webui/assets/sora-latin-500-normal-CmPS9DAJ.woff
/var/lib/shoko/webui/assets/sora-latin-600-normal-DC-VVm69.woff
/var/lib/shoko/webui/assets/sora-latin-700-normal-7BwG48_h.woff
/var/lib/shoko/webui/assets/sora-latin-800-normal-PDlJt_sS.woff
/var/lib/shoko/webui/assets/sora-latin-400-normal-woMVPSgH.woff
/var/lib/shoko/webui/assets/monaco-editor-CWFJhXPe.css
/var/lib/shoko/webui/assets/index-CjvHA5ht.css
/var/lib/shoko/webui/assets/sora-latin-300-normal-_gcayfTt.woff
/var/lib/shoko/webui/assets/shoko_mascot-BxR7aIJM.png
/var/lib/shoko/webui/assets/@monaco-editor
/var/lib/shoko/webui/assets/@monaco-editor/react-CmuKTs2V.js
/var/lib/shoko/webui/assets/@monaco-editor/react-CmuKTs2V.js.map
/var/lib/shoko/webui/assets/common-0jV1spn5.js
/var/lib/shoko/webui/assets/monaco-editor-gpLA3-Rd.js
/var/lib/shoko/webui/assets/vendor-DsPoBL21.js
/var/lib/shoko/webui/assets/index-s1tCB-Bw.js
/var/lib/shoko/webui/assets/RenamerEditor-BgClqkFS.js
/var/lib/shoko/webui/assets/javascript-BrYQgcVz.js
/var/lib/shoko/webui/assets/lua-nf6ki56Z.js
/var/lib/shoko/webui/assets/typescript-Bu_7SVrm.js
/var/lib/shoko/webui/assets/yaml-CqiVQN8T.js
/var/lib/shoko/webui/assets/typescript-Bu_7SVrm.js.map
/var/lib/shoko/webui/assets/yaml-CqiVQN8T.js.map
/var/lib/shoko/webui/assets/lua-nf6ki56Z.js.map
/var/lib/shoko/webui/assets/RenamerEditor-BgClqkFS.js.map
/var/lib/shoko/webui/assets/javascript-BrYQgcVz.js.map
/var/lib/shoko/webui/assets/common-0jV1spn5.js.map
/var/lib/shoko/webui/assets/index-s1tCB-Bw.js.map
/var/lib/shoko/webui/assets/vendor-DsPoBL21.js.map
/var/lib/shoko/webui/assets/monaco-editor-gpLA3-Rd.js.map
/var/lib/shoko/webui/assets/editor.worker-oRlJJsnX.js.map
/var/lib/shoko/webui/assets/editor.worker-oRlJJsnX.js
/var/lib/shoko/webui/index.html Since the file doesn't exist and dotnet throws an access denied error, most likely the parent directory has permission issues: [root@machine:/]# stat /var/lib/shoko/
File: /var/lib/shoko/
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 253,0 Inode: 168 Links: 2
Access: (0700/drwx------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2025-01-20 11:03:11.662780450 +0000
Modify: 2025-01-20 11:01:03.098375196 +0000
Change: 2025-01-20 11:01:03.098375196 +0000
Birth: 2025-01-20 11:01:03.085373543 +0000 Conclusion/TLDR
diff --git a/nixos/modules/services/misc/shoko.nix b/nixos/modules/services/misc/shoko.nix
index de000171f828..ebc7ed82e19d 100644
--- a/nixos/modules/services/misc/shoko.nix
+++ b/nixos/modules/services/misc/shoko.nix
@@ -70,7 +70,7 @@ in
# imperative plugins as well), then symlink the specified plugins.
system.activationScripts.shoko =
''
- install -dm700 '${cfg.dataDir}'
+ install -dm700 -o shoko -g shoko '${cfg.dataDir}'
''
+ optionalString (cfg.webui != null) ''
rm -rf '${cfg.dataDir}/webui'
|
Yeah, I've found it since, but the fix won't be that simple since I gotta redo some stuff anyway |
Alright, that should do it. @gepbird I'd appreciate some testing, if you have the time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test works now and changes LGTM, thanks!
I was a bit bothered by making filesystem changes in systemd.activationScript
and tried to replace it with systemd.tmpfiles.rules
and systemd.services.shoko.serviceConfig.ExecStartPre
but failed. Your solution with StateDirectory
and preStart
is much cleaner, nicely done.
Adds a NixOS module for https://github.com/ShokoAnime/ShokoServer, along with derivations for the module's dependencies.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.