1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-05-13 06:15:15 +00:00

added tgt and my sex

This commit is contained in:
nixzoid 2025-02-22 21:21:36 +09:00
parent 8a209938ac
commit a681f0a67c
15 changed files with 259 additions and 12 deletions

2
flake.lock generated
View file

@ -723,7 +723,7 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-g/tikq82VxySOiWdGbMFHoq37aLPwSeT76FNZwWlZHo=",
"narHash": "sha256-7gc7d8zw+6qTttJ/gsDORCrro+eKBFj5gPUvt2jASVI=",
"path": "xpackages",
"type": "path"
},

View file

@ -23,6 +23,7 @@ in
lsd = off;
micro = off;
rustmission = off;
tgt = on;
top = on;
yazi = on;
};

View file

@ -32,6 +32,10 @@ in
optipng
lutgen
mini-calc
todo
nb
cachix
wyvern
hut

View file

@ -0,0 +1,15 @@
# toml
''
mouse_support = false
paste_support = true
#
show_status_bar = false
show_title_bar = false
#
frame_rate = 80.0
theme_enable = true
theme_filename = "theme.toml"
#
take_api_id_from_telegram_config = true
take_api_hash_from_telegram_config = true
''

View file

@ -0,0 +1,59 @@
# toml
''
[core_window]
keymap = [
# quit
{ keys = ["q"], command = "try_quit", description = "Quit the application"},
{ keys = ["esc"], command = "unfocus_component", description = "Unfocus the current component"},
{ keys = ["alt+x"], command = "toggle_chat_list", description = "Toggle chat_list visibility"},
{ keys = ["alt+1"], command = "focus_chat_list", description = "Focus the chat list"},
{ keys = ["alt+2"], command = "focus_chat", description = "Focus the chat"},
{ keys = ["alt+3"], command = "focus_prompt", description = "Focus the prompt"},
# size vhat list
{ keys = ["ctrl+l"], command = "increase_chat_list_size", description = "Increase the chat list size"},
{ keys = ["ctrl+h"], command = "decrease_chat_list_size", description = "Decrease the chat list size"},
{ keys = ["ctrl+k"], command = "increase_prompt_size", description = "Increase the prompt size"},
{ keys = ["ctrl+j"], command = "decrease_prompt_size", description = "Decrease the prompt size"},
# additional
# arrows
{ keys = ["alt+left"], command = "focus_chat_list", description = "Focus the chat list"},
{ keys = ["alt+right"], command = "focus_chat", description = "Focus the chat"},
{ keys = ["alt+down"], command = "focus_prompt", description = "Focus the prompt"},
# vi keys
{ keys = ["alt+h"], command = "focus_chat_list", description = "Focus the chat list"},
{ keys = ["alt+l"], command = "focus_chat", description = "Focus the chat"},
{ keys = ["alt+j"], command = "focus_prompt", description = "Focus the prompt"},
]
[chat_list]
keymap = [
# arrows
{ keys = ["down"], command = "chat_list_next", description = "Select the next chat"},
{ keys = ["up"], command = "chat_list_previous", description = "Select the previous chat"},
{ keys = ["left"], command = "chat_list_unselect", description = "Unselect the current chat"},
{ keys = ["right"], command = "chat_list_open", description = "Open the selected chat"},
# vi keys
{ keys = ["j"], command = "chat_list_next", description = "Select the next chat"},
{ keys = ["k"], command = "chat_list_previous", description = "Select the previous chat"},
{ keys = ["h"], command = "chat_list_unselect", description = "Unselect the current chat"},
{ keys = ["l"], command = "chat_list_open", description = "Open the selected chat"},
# ok
{ keys = ["enter"], command = "chat_list_open", description = "Open the selected chat"},
]
[chat]
keymap = [
# vi keys
{ keys = ["j"], command = "chat_window_next", description = "Select the next message"},
{ keys = ["k"], command = "chat_window_previous", description = "Select the previous message"},
{ keys = ["h"], command = "chat_window_unselect", description = "Unselect the current message"},
{ keys = ["l"], command = "chat_window_reply", description = "Reply to the selected message"},
# delete
{ keys = ["d"], command = "chat_window_delete_for_everyone", description = "Delete the selected message for all users"},
{ keys = ["D"], command = "chat_window_delete_for_me", description = "Delete the selected message for 'me'"},
# actions
{ keys = ["y"], command = "chat_window_copy", description = "Copy the selected message"},
{ keys = ["e"], command = "chat_window_edit", description = "Edit the selected message"},
{ keys = ["r"], command = "chat_window_reply", description = "Reply to the selected message"},
]
''

View file

@ -0,0 +1,9 @@
# toml
''
rotation_frequency = "never"
log_level = "off"
#
log_dir = ".data/logs"
log_file = "tgt.log"
max_old_log_files = 7
''

View file

@ -0,0 +1,31 @@
{
lib,
...
}:
let
is = lib.x.sys.is;
in
# toml
''
api_id = "25419489"
api_hash = "81ae396dca8b973697fb9c5d3ad726bb"
#
database_dir = ".data/tg"
use_file_database = true
use_chat_info_database = true
use_message_database = true
system_language_code = "en"
device_model = ${
if is == "laptop" then
"Laptop"
else if is == "desktop" then
"Desktop"
else
"Unknown"
}
verbosity_level = 2
log_path = ".data/tdlib_rs/tdlib_rs.log"
redirect_stderr = false
''

View file

@ -0,0 +1,64 @@
{
config,
...
}:
with config.lib.stylix.colors.withHashtag;
# toml
''
[palette]
background = "${base00}"
background_two = "${base01}"
background_three = "${base02}"
primary_light = "${base06}"
primary = "${base05}"
primary_dark = "${base04}"
secondary_light = "${base05}"
secondary = "${base06}"
secondary_dark = "${base04}"
ternary_light = "${base05}"
ternary = "${base06}"
ternary_dark = "${base04}"
highlight_one = "${base07}"
highlight_two = "${base07}"
[common]
border_component_focused = { fg = "background_two", bg = "background", bold = false, underline = false, italic = false }
item_selected = { fg = "", bg = "background_two", bold = true, underline = false, italic = false }
timestamp = { fg = "primary_dark", bg = "background", bold = false, underline = false, italic = false }
[chat_list]
self = { fg = "primary", bg = "background", bold = false, underline = false, italic = false }
item_selected = { fg = "", bg = "background_two", bold = false, underline = false, italic = false }
item_chat_name = { fg = "primary_light", bg = "background", bold = true, underline = false, italic = false }
item_message_content = { fg = "primary_dark", bg = "background", bold = false, underline = false, italic = true }
item_unread_counter = { fg = "highlight_two", bg = "background", bold = true, underline = false, italic = false }
[chat]
self = { fg = "primary", bg = "background", bold = false, underline = false, italic = false }
chat_name = { fg = "ternary", bg = "background", bold = true, underline = false, italic = false }
message_myself_name = { fg = "secondary", bg = "background", bold = true, underline = false, italic = false }
message_myself_content = { fg = "secondary_light", bg = "background", bold = false, underline = false, italic = false }
message_other_name = { fg = "ternary", bg = "background", bold = true, underline = false, italic = false }
message_other_content = { fg = "ternary_light", bg = "background", bold = false, underline = false, italic = false }
message_reply_text = { fg = "primary", bg = "background", bold = false, underline = false, italic = false }
message_myself_reply_name = { fg = "ternary_dark", bg = "background", bold = true, underline = false, italic = false }
message_myself_reply_content = { fg = "primary_dark", bg = "background", bold = false, underline = false, italic = false }
message_other_reply_name = { fg = "secondary_dark", bg = "background", bold = true, underline = false, italic = false }
message_other_reply_content = { fg = "primary_dark", bg = "background", bold = false, underline = false, italic = false }
[prompt]
self = { fg = "primary", bg = "background", bold = false, underline = false, italic = false }
message_text = { fg = "primary_light", bg = "background", bold = false, underline = false, italic = false }
message_text_selected = { fg = "primary_light", bg = "background_three", bold = false, underline = false, italic = true }
message_preview_text = { fg = "primary_dark", bg = "background", bold = false, underline = false, italic = false }
[reply_message]
self = { fg = "highlight_two", bg = "background", bold = false, underline = false, italic = false }
message_text = { fg = "primary", bg = "background", bold = false, underline = false, italic = false }
''

View file

@ -0,0 +1,31 @@
{
inputs,
lib,
config,
...
}:
with lib;
with x;
let
cfg = config.module.programs.cli.tgt;
in
{
options = {
module.programs.cli.tgt = {
enable = mkBool false;
};
};
config = mkIf cfg.enable {
home.packages = [ inputs.xpk.tgt ];
home.file = {
".tgt/config/app.toml".text = import ./conf_nix/app.nix;
".tgt/config/theme.toml".text = import ./conf_nix/theme.nix { inherit config; };
".tgt/config/logger.toml".text = import ./conf_nix/logger.nix;
".tgt/config/keymap.toml".text = import ./conf_nix/keymap.nix;
".tgt/config/telegram.toml".text = import ./conf_nix/telegram.nix { inherit lib; };
};
};
}

View file

@ -6,10 +6,11 @@
let
inherit (inputs) nixpkgs home nixcord;
secrets = ../../secrets.nix;
# make configuration
mkMachine =
machineName:
{
args@{
sys ? {
hostName = "starship";
userName = "amogus";
@ -25,6 +26,7 @@ let
theme = "horizon-dark";
image = "train";
},
sec ? (builtins.pathExists secrets) import secrets args,
}:
let
@ -39,6 +41,7 @@ let
path
styl
sys
sec
;
}
// import ./options.nix { inherit self pkgs lib; }

View file

@ -28,4 +28,4 @@ let
scope = scopeFromDirectory ./pkgs;
in
flattenPkgs "/" [ ] legacyPackages
(flattenPkgs "/" [ ] legacyPackages)

View file

@ -7,7 +7,7 @@ pkgs.python3Packages.buildPythonApplication rec {
src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-P4dJL9V1uihNsF9mqjay3PbncjnBuKbmPhufDv5l7Uk=";
hash = "sha256-UaV781K0AfXwGoRPxLDSEFL7YG1Bp+OxCoxtVCwu90o=";
};
build-system = with pkgs.python3Packages; [

View file

@ -0,0 +1,20 @@
{ pkgs }:
pkgs.buildGoModule rec {
pname = "hash";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "hrishiksh";
repo = "hash";
rev = "v${version}";
hash = "sha256-pfHoCDK2fKTeLSONfgBV74OPzubZO8K69w9VKT9cBOg=";
};
vendorHash = "sha256-qibxT8ny8ruA9C6LPAlKiXS/vb8VY+1DjPQx/MUKG20=";
ldflags = [
"-s"
"-w"
];
}

View file

@ -2,8 +2,14 @@
with pkgs;
let
rLinkLibs = builtins.attrValues {
inherit (pkgs) pkg-config openssl;
build = builtins.attrValues {
inherit (pkgs)
pkg-config
openssl
wayland
bzip2
zstd
;
tdlib = tdlib.overrideAttrs {
version = "1.8.29";
src = fetchFromGitHub {
@ -27,23 +33,26 @@ pkgs.rustPlatform.buildRustPackage {
src = pkgs.fetchFromGitHub {
owner = "FedericoBruzzone";
repo = "tgt";
rev = "39fb4acec241e2db384e268c77e875bd13a48c12";
sha256 = "sha256-McZEnRwtGEuhDA1uJ1FgUl6QiPfzCDr/Pl2haF9+MRw=";
rev = "38768515feb890fe15df08b5f1c1306370fd647a";
hash = "sha256-6UnvYjwizAXGL7+8MX8xNGJssHIAL9PBmhqeUHFpb3A=";
};
cargoHash = "sha256-WIs9rVhTQn217DHIw1SPnQrkDtozEl2jfqVjTwJHF2w=";
nativeBuildInputs = rLinkLibs;
buildInputs = rLinkLibs;
useFetchCargoVendor = true;
cargoHash = "sha256-sEQQ6gsrbeHTfQ4AURNRMYb+kUKl9Zgw0+pHSpSlxNU=";
nativeBuildInputs = build;
buildInputs = build;
patches = [
(fetchurl {
url = "https://github.com/FedericoBruzzone/tgt/raw/refs/heads/main/patches/0001-check-filesystem-writability-before-operations.patch";
url = "https://raw.githubusercontent.com/FedericoBruzzone/tgt/38768515feb890fe15df08b5f1c1306370fd647a/patches/0001-check-filesystem-writability-before-operations.patch";
sha256 = "sha256-ugztN6YAZEmpXndhMDGRPRuEOgGWS7cACXQ/Yj1soXw=";
})
];
env = {
RUSTFLAGS = "-C link-arg=-Wl,-rpath,${tdlib}/lib -L ${pkgs.openssl}/lib";
ZSTD_SYS_USE_PKG_CONFIG = true;
LOCAL_TDLIB_PATH = "${tdlib}/lib";
};
}

1
xpackages/pkgs/tgt/result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/6h8v730qlasynw78rfx89d2qxj9gq0cx-tgt-unstable-2024-11-04