Compare commits
5 Commits
3c42130b69
...
nixos
| Author | SHA1 | Date | |
|---|---|---|---|
|
b86cc94d23
|
|||
|
95825c6ff1
|
|||
|
3e7e404d4c
|
|||
|
bb4c77208d
|
|||
|
1f53cd2efb
|
@@ -16,6 +16,7 @@
|
|||||||
domain = {
|
domain = {
|
||||||
natto = "weirdnatto.in";
|
natto = "weirdnatto.in";
|
||||||
amneesh = "amneesh.com";
|
amneesh = "amneesh.com";
|
||||||
|
chutiya = "chutiya.online";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
851
flake.lock
generated
851
flake.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -52,7 +52,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
filehost = {
|
filehost = {
|
||||||
url = "github:natto1784/simpler-filehost";
|
url = "github:natto1784/yamaf";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-gaming.url = "github:fufexan/nix-gaming";
|
nix-gaming.url = "github:fufexan/nix-gaming";
|
||||||
|
|||||||
@@ -34,7 +34,9 @@
|
|||||||
scroll-step 1
|
scroll-step 1
|
||||||
display-line-numbers-type 'relative
|
display-line-numbers-type 'relative
|
||||||
confirm-kill-processes nil
|
confirm-kill-processes nil
|
||||||
inhibit-startup-screen t)
|
inhibit-startup-screen t
|
||||||
|
isearch-lazy-count t
|
||||||
|
lazy-count-prefix-format "[%s/%s] ")
|
||||||
(setq-default tab-width 2
|
(setq-default tab-width 2
|
||||||
indent-tabs-mode nil)
|
indent-tabs-mode nil)
|
||||||
#+end_src
|
#+end_src
|
||||||
@@ -78,6 +80,15 @@
|
|||||||
(dark-theme t))
|
(dark-theme t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** Indent guides
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package highlight-indent-guides
|
||||||
|
:config
|
||||||
|
(setq highlight-indent-guides-method 'column)
|
||||||
|
:hook
|
||||||
|
(prog-mode . highlight-indent-guides-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Minibuffer
|
** Minibuffer
|
||||||
Enable vertico
|
Enable vertico
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@@ -192,8 +203,8 @@ To undo and redo easily like vi
|
|||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:defer t
|
:defer t
|
||||||
:commands lsp
|
:commands lsp
|
||||||
:init
|
:init (setq lsp-enable-on-type-formatting nil)
|
||||||
(setq lsp-enable-on-type-formatting nil))
|
:hook (prog-mode . lsp-deferred))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Configure lsp-ui
|
*** Configure lsp-ui
|
||||||
@@ -514,24 +525,6 @@ Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_i
|
|||||||
(vterm-send-return)))
|
(vterm-send-return)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Compilation shortcuts for standalone files
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(defun candrun ()
|
|
||||||
(let ((full buffer-file-name)
|
|
||||||
(file (file-name-sans-extension buffer-file-name)))
|
|
||||||
(pcase (file-name-extension full)
|
|
||||||
("c" (concat "gcc " full " -lm -pthread -o " file " && " file " && rm " file))
|
|
||||||
("java" (concat "java " full))
|
|
||||||
("py" (concat "python " full))
|
|
||||||
("cpp" (concat "g++ " full " -o " file " && " file " && rm " file))
|
|
||||||
("cc" (concat "g++ " full " -o " file " && " file " && rm " file))
|
|
||||||
("hs" (concat "runhaskell " full))
|
|
||||||
("sh" (concat "sh " full))
|
|
||||||
("js" (concat "node " full))
|
|
||||||
("ts" (concat "tsc " full " && node " file ".js && rm " file ".js" ))
|
|
||||||
("rs" (concat "rustc " full " -o " file " && " file " && rm " file)))))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* LLMs
|
* LLMs
|
||||||
** gptel
|
** gptel
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@@ -621,8 +614,7 @@ not using this anymore
|
|||||||
"<f4>" (lambda () (interactive) (vterm t))
|
"<f4>" (lambda () (interactive) (vterm t))
|
||||||
"C-S-t" 'vterm-toggle-cd
|
"C-S-t" 'vterm-toggle-cd
|
||||||
"C-t" 'vterm-toggle
|
"C-t" 'vterm-toggle
|
||||||
"<f1>" 'vterm-toggle
|
"<f1>" 'vterm-toggle)
|
||||||
"<f5>" (lambda () (interactive) (run-in-vterm (candrun))))
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps 'vterm-mode-map
|
:keymaps 'vterm-mode-map
|
||||||
"<f3>" 'vterm-toggle-forward
|
"<f3>" 'vterm-toggle-forward
|
||||||
|
|||||||
@@ -24,11 +24,21 @@ in
|
|||||||
alwaysEnsure = true;
|
alwaysEnsure = true;
|
||||||
alwaysTangle = true;
|
alwaysTangle = true;
|
||||||
defaultInitFile = true;
|
defaultInitFile = true;
|
||||||
extraEmacsPackages =
|
extraEmacsPackages = epkgs: with epkgs; [
|
||||||
epkgs: with epkgs; [
|
|
||||||
use-package
|
use-package
|
||||||
(tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins))
|
(tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
override = final: prev: {
|
||||||
|
evil = prev.melpaPackages.evil.overrideAttrs(_: {
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "natto1784";
|
||||||
|
repo = "evil";
|
||||||
|
rev = "isearch-lazy-count";
|
||||||
|
sha256 = "sha256-YqXoqPqOWRvszzktb0MYHMe590mzTQxCMgBloy3MHkQ=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.emacs = {
|
services.emacs = {
|
||||||
|
|||||||
@@ -1,25 +1,39 @@
|
|||||||
{
|
{
|
||||||
config,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
inputs,
|
||||||
conf,
|
conf,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
systemd.services.filehost = {
|
systemd.services = rec {
|
||||||
enable = true;
|
filehost = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
enable = true;
|
||||||
serviceConfig = {
|
wantedBy = [ "multi-user.target" ];
|
||||||
Type = "simple";
|
serviceConfig = {
|
||||||
Environment = [
|
Type = "simple";
|
||||||
"TITLE=nattofiles"
|
Environment = [
|
||||||
"USER_URL=https://f.${conf.network.addresses.domain.natto}"
|
"TITLE=nattofiles"
|
||||||
"ROCKET_LIMITS={file=\"512MB\",data-form=\"512MB\"}"
|
"INTERNAL_HOST=0.0.0.0"
|
||||||
"ROCKET_LOG_LEVEL=debug"
|
"INTERNAL_PORT=8000"
|
||||||
"ROCKET_ADDRESS=0.0.0.0"
|
"MAX_FILESIZE_MB=500"
|
||||||
];
|
"EXTERNAL_HAS_TLS=1"
|
||||||
Restart = "on-failure";
|
"EXTERNAL_HOST=f.${conf.network.addresses.domain.natto}"
|
||||||
ExecStart = "${inputs.filehost.packages.${pkgs.system}.simpler-filehost}/bin/simpler-filehost";
|
];
|
||||||
|
Restart = "on-failure";
|
||||||
|
ExecStart = "${inputs.filehost.packages.${pkgs.system}.yamaf}/bin/yamaf";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
filehost-chutiya = lib.recursiveUpdate filehost {
|
||||||
|
serviceConfig.Environment = [
|
||||||
|
"TITLE=chutiyafiles"
|
||||||
|
"INTERNAL_HOST=0.0.0.0"
|
||||||
|
"INTERNAL_PORT=8001"
|
||||||
|
"MAX_FILESIZE_MB=500"
|
||||||
|
"EXTERNAL_HAS_TLS=1"
|
||||||
|
"EXTERNAL_HOST=f.${conf.network.addresses.domain.chutiya}"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
conf,
|
conf,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -36,6 +35,18 @@
|
|||||||
USER = FROM;
|
USER = FROM;
|
||||||
REGISTER_MAIL_CONFIRM = true;
|
REGISTER_MAIL_CONFIRM = true;
|
||||||
};
|
};
|
||||||
|
service = {
|
||||||
|
ENABLE_CAPTCHA = true;
|
||||||
|
EMAIL_DOMAIN_ALLOWLIST = lib.strings.concatStringsSep "," [
|
||||||
|
"gmail.com"
|
||||||
|
"outlook.com"
|
||||||
|
"proton.me"
|
||||||
|
"protonmail.com"
|
||||||
|
conf.network.addresses.domain.natto
|
||||||
|
conf.network.addresses.domain.amneesh
|
||||||
|
conf.network.addresses.domain.chutiya
|
||||||
|
];
|
||||||
|
};
|
||||||
oauth2_client.REGISTER_MAIL_CONFIRM = true;
|
oauth2_client.REGISTER_MAIL_CONFIRM = true;
|
||||||
actions.ENABLED = false;
|
actions.ENABLED = false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{ conf, ... }:
|
{ conf, ... }:
|
||||||
let
|
let
|
||||||
domain = conf.network.addresses.domain.natto;
|
domain = conf.network.addresses.domain.natto;
|
||||||
|
chutiya = conf.network.addresses.domain.chutiya;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
@@ -35,6 +36,17 @@ in
|
|||||||
in
|
in
|
||||||
with conf.network.addresses.wireguard.ips;
|
with conf.network.addresses.wireguard.ips;
|
||||||
{
|
{
|
||||||
|
|
||||||
|
"${chutiya}" = {
|
||||||
|
addSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
root = "/var/lib/chutiya";
|
||||||
|
index = "index.html";
|
||||||
|
};
|
||||||
|
serverAliases = [ "www.${chutiya}" ];
|
||||||
|
};
|
||||||
|
|
||||||
"moj.${domain}" = genericHttpRProxy { addr = "https://${suwako}:25565"; };
|
"moj.${domain}" = genericHttpRProxy { addr = "https://${suwako}:25565"; };
|
||||||
|
|
||||||
"puffer.${domain}" = genericHttpRProxy {
|
"puffer.${domain}" = genericHttpRProxy {
|
||||||
@@ -59,7 +71,15 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Personal filehost
|
# Personal filehost
|
||||||
"f.${domain}" = genericHttpRProxy { addr = "http://${suwako}:8000"; };
|
"f.${chutiya}" = genericHttpRProxy {
|
||||||
|
addr = "http://${suwako}:8001";
|
||||||
|
conf = "client_max_body_size 512M;";
|
||||||
|
};
|
||||||
|
|
||||||
|
"f.${domain}" = genericHttpRProxy {
|
||||||
|
addr = "http://${suwako}:8000";
|
||||||
|
conf = "client_max_body_size 512M;";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user