actually make patches work
This commit is contained in:
parent
09f47e0cd0
commit
962f981d83
|
@ -4,9 +4,10 @@
|
||||||
then "/secrets/music_stream_password"
|
then "/secrets/music_stream_password"
|
||||||
else "$HOME/.secrets/music_stream_password";
|
else "$HOME/.secrets/music_stream_password";
|
||||||
in {
|
in {
|
||||||
home.packages = with pkgs; [mpv ffmpeg yt-dlp];
|
home.packages = with pkgs; [ffmpeg yt-dlp];
|
||||||
programs.mpv = {
|
programs.mpv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
scripts = with pkgs.mpvScripts; [ mpris ];
|
||||||
config = {
|
config = {
|
||||||
script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
|
script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
|
||||||
slang = "en";
|
slang = "en";
|
||||||
|
|
|
@ -138,10 +138,6 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
ensureDatabases = ["misskey"];
|
ensureDatabases = ["misskey"];
|
||||||
initialScript = pkgs.writeText "init" ''
|
|
||||||
create user misskey with password 'password';
|
|
||||||
grant all privileges on database misskey to misskey;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.redis.servers."misskey" = {
|
services.redis.servers."misskey" = {
|
||||||
|
|
|
@ -19,11 +19,15 @@ in
|
||||||
inherit version src;
|
inherit version src;
|
||||||
|
|
||||||
# some of my own personal patches
|
# some of my own personal patches
|
||||||
# copy-link-non-monospace doesn't do much on https, no idea why
|
patches = [
|
||||||
patches = [./copy-link-non-monospace.patch ./reorder-note-menu.patch];
|
# Nya!
|
||||||
|
./search-allow-query-posts-and-users.patch
|
||||||
|
./copy-link-non-monospace.patch
|
||||||
|
./reorder-note-menu.patch
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp -r $src $out
|
cp -r . $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
40
overlay/misskey/search-allow-query-posts-and-users.patch
Normal file
40
overlay/misskey/search-allow-query-posts-and-users.patch
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
diff --git a/packages/client/src/pages/search.vue b/packages/client/src/pages/search.vue
|
||||||
|
index c080b76..cdfb47c 100644
|
||||||
|
--- a/packages/client/src/pages/search.vue
|
||||||
|
+++ b/packages/client/src/pages/search.vue
|
||||||
|
@@ -12,12 +12,35 @@ import { computed } from 'vue';
|
||||||
|
import XNotes from '@/components/MkNotes.vue';
|
||||||
|
import { i18n } from '@/i18n';
|
||||||
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||||
|
+import * as os from '@/os';
|
||||||
|
+import { mainRouter } from '@/router';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
query: string;
|
||||||
|
channel?: string;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
+const query = props.query;
|
||||||
|
+
|
||||||
|
+# TODO: get this to work without being logged in
|
||||||
|
+if (localStorage.getItem('account') != null) {
|
||||||
|
+ if (query.startsWith('https://') || (query.startsWith('@') && !query.includes(' '))) {
|
||||||
|
+ const promise = os.api('ap/show', {
|
||||||
|
+ uri: props.query,
|
||||||
|
+ });
|
||||||
|
+
|
||||||
|
+ os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);
|
||||||
|
+
|
||||||
|
+ const res = await promise;
|
||||||
|
+
|
||||||
|
+ if (res.type === 'User') {
|
||||||
|
+ mainRouter.replace(`/@${res.object.username}@${res.object.host}`);
|
||||||
|
+ } else if (res.type === 'Note') {
|
||||||
|
+ mainRouter.replace(`/notes/${res.object.id}`);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
const pagination = {
|
||||||
|
endpoint: 'notes/search' as const,
|
||||||
|
limit: 10,
|
Loading…
Reference in a new issue