Compare commits
7 Commits
4a18ae77fc
...
nixos
| Author | SHA1 | Date | |
|---|---|---|---|
|
b86cc94d23
|
|||
|
95825c6ff1
|
|||
|
3e7e404d4c
|
|||
|
bb4c77208d
|
|||
|
1f53cd2efb
|
|||
|
d9f8c16011
|
|||
|
4335805701
|
@@ -16,6 +16,7 @@
|
||||
domain = {
|
||||
natto = "weirdnatto.in";
|
||||
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 = {
|
||||
url = "github:natto1784/simpler-filehost";
|
||||
url = "github:natto1784/yamaf";
|
||||
};
|
||||
|
||||
nix-gaming.url = "github:fufexan/nix-gaming";
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
scroll-step 1
|
||||
display-line-numbers-type 'relative
|
||||
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
|
||||
indent-tabs-mode nil)
|
||||
#+end_src
|
||||
@@ -58,8 +60,7 @@
|
||||
#+begin_src emacs-lisp
|
||||
(use-package benchmark-init
|
||||
:config
|
||||
;; To disable collection of benchmark data after init is done.
|
||||
:init (benchmark-init/deactivate))
|
||||
(add-hook 'after-init-hook 'benchmark-init/deactivate) )
|
||||
#+end_src
|
||||
|
||||
** Visual packages
|
||||
@@ -79,6 +80,15 @@
|
||||
(dark-theme t))
|
||||
#+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
|
||||
Enable vertico
|
||||
#+begin_src emacs-lisp
|
||||
@@ -139,6 +149,7 @@ Consult
|
||||
(use-package evil
|
||||
:init
|
||||
(setq-default evil-shift-width 2)
|
||||
(setq evil-want-keybinding nil)
|
||||
:config
|
||||
(evil-set-initial-state 'vterm-mode 'insert)
|
||||
(evil-set-undo-system 'undo-tree)
|
||||
@@ -192,8 +203,8 @@ To undo and redo easily like vi
|
||||
(use-package lsp-mode
|
||||
:defer t
|
||||
:commands lsp
|
||||
:init
|
||||
(setq lsp-enable-on-type-formatting nil))
|
||||
:init (setq lsp-enable-on-type-formatting nil)
|
||||
:hook (prog-mode . lsp-deferred))
|
||||
#+end_src
|
||||
|
||||
*** Configure lsp-ui
|
||||
@@ -235,7 +246,6 @@ For autocomplete
|
||||
(add-to-list 'company-backends 'company-dabbrev)
|
||||
(setq company-backends (append '(company-files) (remove 'company-files company-backends)))
|
||||
:hook (after-init . global-company-mode))
|
||||
|
||||
#+end_src
|
||||
|
||||
*** Configure company-quickhelp
|
||||
@@ -358,24 +368,64 @@ Do not use centaur tabs for now
|
||||
#+end_src
|
||||
|
||||
** Misc packages
|
||||
*** Icons
|
||||
For installing icons
|
||||
#+begin_src emacs-lisp
|
||||
(use-package all-the-icons
|
||||
:defer t
|
||||
:if (display-graphic-p))
|
||||
#+end_src
|
||||
|
||||
(use-package elcord :defer t)
|
||||
|
||||
*** Projectile
|
||||
For tracking project root
|
||||
#+begin_src emacs-lisp
|
||||
(use-package projectile
|
||||
:defer t
|
||||
:config
|
||||
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
|
||||
(projectile-mode +1))
|
||||
#+end_src
|
||||
|
||||
*** Rainbow
|
||||
For highlighting colors
|
||||
#+begin_src emacs-lisp
|
||||
(use-package rainbow-mode :defer t)
|
||||
#+end_src
|
||||
|
||||
*** Rainbow delimiters
|
||||
To make distinguishing parens easier
|
||||
#+begin_src emacs-lisp
|
||||
(use-package rainbow-delimiters
|
||||
:hook (prog-mode . rainbow-delimiters-mode))
|
||||
#+end_src
|
||||
|
||||
*** Olivetti
|
||||
When you want write prose or something similar
|
||||
#+begin_src emacs-lisp
|
||||
(use-package olivetti
|
||||
:defer t
|
||||
:diminish olivetti-mode
|
||||
:custom
|
||||
(olivetti-body-width 100)
|
||||
(olivetti-minimum-body-width 50)
|
||||
(olivetti-style 'fancy)
|
||||
(olivetti-recall-visual-line-mode-entry-state t)
|
||||
:config
|
||||
(defvar-local my/olivetti--saved-line-numbers nil
|
||||
"Stores the previous value of `display-line-numbers` before enabling Olivetti.")
|
||||
|
||||
(defun my/olivetti-toggle-line-numbers ()
|
||||
"Hide line numbers when entering Olivetti, restore when exiting."
|
||||
(if olivetti-mode
|
||||
(progn
|
||||
(setq my/olivetti--saved-line-numbers display-line-numbers)
|
||||
(setq display-line-numbers nil))
|
||||
(setq display-line-numbers my/olivetti--saved-line-numbers)))
|
||||
|
||||
(add-hook 'olivetti-mode-hook #'my/olivetti-toggle-line-numbers))
|
||||
#+end_src
|
||||
|
||||
|
||||
** Org
|
||||
** Add org-mode
|
||||
#+begin_src emacs-lisp
|
||||
@@ -423,22 +473,31 @@ Do not use centaur tabs for now
|
||||
(latex . t)))
|
||||
#+end_src
|
||||
|
||||
* Mode specific hooks
|
||||
#+begin_src emacs-lisp
|
||||
(add-hook 'c-mode-hook 'lsp)
|
||||
(add-hook 'c++-mode-hook 'lsp)
|
||||
(add-hook 'haskell-mode-hook #'lsp)
|
||||
(add-hook 'haskell-literate-mode-hook #'lsp)
|
||||
#+end_src
|
||||
|
||||
* Random eye candy stuff
|
||||
|
||||
* Custom mode line
|
||||
switched to doom modeline after using my own modeline for a while
|
||||
* Mode line
|
||||
** Doom modeline
|
||||
Switched to doom modeline after using my own modeline for a while
|
||||
#+begin_src emacs-lisp
|
||||
(use-package doom-modeline
|
||||
:init (doom-modeline-mode 1))
|
||||
#+end_src
|
||||
Also show columns
|
||||
#+begin_src emacs-lisp
|
||||
(column-number-mode 1)
|
||||
#+end_src
|
||||
|
||||
** Nyan Mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package nyan-mode
|
||||
:ensure t
|
||||
:init
|
||||
(when (display-graphic-p)
|
||||
(nyan-mode 1))
|
||||
:custom
|
||||
(nyan-animate-nyancat t)
|
||||
:config
|
||||
(nyan-start-animation))
|
||||
#+end_src
|
||||
|
||||
* Pop-up terminal
|
||||
Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_in_new_vterm/][this]] reddit post
|
||||
@@ -466,28 +525,11 @@ Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_i
|
||||
(vterm-send-return)))
|
||||
#+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
|
||||
** gptel
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gptel
|
||||
:defer t
|
||||
:config
|
||||
(setq gptel-model 'claude-sonnet-4-20250514
|
||||
gptel-backend (gptel-make-anthropic "Claude"
|
||||
@@ -503,6 +545,7 @@ Compilation shortcuts for standalone files
|
||||
** Aidermacs
|
||||
#+begin_src emacs-lisp
|
||||
(use-package aidermacs
|
||||
:defer t
|
||||
:bind (("C-c a" . aidermacs-transient-menu))
|
||||
:custom
|
||||
; See the Configuration section below
|
||||
@@ -571,8 +614,7 @@ not using this anymore
|
||||
"<f4>" (lambda () (interactive) (vterm t))
|
||||
"C-S-t" 'vterm-toggle-cd
|
||||
"C-t" 'vterm-toggle
|
||||
"<f1>" 'vterm-toggle
|
||||
"<f5>" (lambda () (interactive) (run-in-vterm (candrun))))
|
||||
"<f1>" 'vterm-toggle)
|
||||
(general-define-key
|
||||
:keymaps 'vterm-mode-map
|
||||
"<f3>" 'vterm-toggle-forward
|
||||
|
||||
@@ -24,11 +24,21 @@ in
|
||||
alwaysEnsure = true;
|
||||
alwaysTangle = true;
|
||||
defaultInitFile = true;
|
||||
extraEmacsPackages =
|
||||
epkgs: with epkgs; [
|
||||
extraEmacsPackages = epkgs: with epkgs; [
|
||||
use-package
|
||||
(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 = {
|
||||
|
||||
@@ -1,25 +1,39 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
conf,
|
||||
...
|
||||
}:
|
||||
{
|
||||
systemd.services.filehost = {
|
||||
systemd.services = rec {
|
||||
filehost = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Environment = [
|
||||
"TITLE=nattofiles"
|
||||
"USER_URL=https://f.${conf.network.addresses.domain.natto}"
|
||||
"ROCKET_LIMITS={file=\"512MB\",data-form=\"512MB\"}"
|
||||
"ROCKET_LOG_LEVEL=debug"
|
||||
"ROCKET_ADDRESS=0.0.0.0"
|
||||
"INTERNAL_HOST=0.0.0.0"
|
||||
"INTERNAL_PORT=8000"
|
||||
"MAX_FILESIZE_MB=500"
|
||||
"EXTERNAL_HAS_TLS=1"
|
||||
"EXTERNAL_HOST=f.${conf.network.addresses.domain.natto}"
|
||||
];
|
||||
Restart = "on-failure";
|
||||
ExecStart = "${inputs.filehost.packages.${pkgs.system}.simpler-filehost}/bin/simpler-filehost";
|
||||
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,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -36,6 +35,18 @@
|
||||
USER = FROM;
|
||||
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;
|
||||
actions.ENABLED = false;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ conf, ... }:
|
||||
let
|
||||
domain = conf.network.addresses.domain.natto;
|
||||
chutiya = conf.network.addresses.domain.chutiya;
|
||||
in
|
||||
{
|
||||
services.nginx = {
|
||||
@@ -35,6 +36,17 @@ in
|
||||
in
|
||||
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"; };
|
||||
|
||||
"puffer.${domain}" = genericHttpRProxy {
|
||||
@@ -59,7 +71,15 @@ in
|
||||
};
|
||||
|
||||
# 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