- firewall rule for VNC for `pc` host
- `go-translate` emacs package with custom bindings
- `magit-delta` to improve diffs readability with `magit` through
  `delta`
- `fira-code-mode` enabled only in `prog-mode`
- `mpv` is spawned by `qutebrowser` without waiting for video being
  loaded
This commit is contained in:
Andrea Ciceri 2022-04-30 14:07:16 +02:00
parent 99cd09401a
commit 6791cb51a2
No known key found for this signature in database
GPG key ID: A1FC89532D1C5654
12 changed files with 64 additions and 10 deletions

1
emacs.d Symbolic link
View file

@ -0,0 +1 @@
users/profiles/emacs/emacs.d

6
flake.lock generated
View file

@ -274,11 +274,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1649849514, "lastModified": 1650522846,
"narHash": "sha256-zQyTr2UebTKUh1KLyLtevhHsM8umPK1LfQLGUGjRjiQ=", "narHash": "sha256-SxWHXRI3qJwswyXAtzsi6PKVY3KLNNnb072KaJthII8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "1a0ccdbf4583ed0fce37eea7955e8ef90f840a9f", "rev": "6b4ebea9093c997c5f275c820e679108de4871ab",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -51,6 +51,15 @@
}; };
}; };
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
5900 # vnc
];
};
# TODO: disable, only for playing # TODO: disable, only for playing
services.hydra = { services.hydra = {
enable = true; enable = true;

View file

@ -18,6 +18,7 @@ emacsWithPackages (
evil-collection evil-collection
fira-code-mode fira-code-mode
good-scroll good-scroll
go-translate
haskell-mode haskell-mode
helm helm
helm-ag helm-ag
@ -28,6 +29,7 @@ emacsWithPackages (
lsp-mode lsp-mode
lsp-python-ms lsp-python-ms
magit magit
magit-delta
nix-mode nix-mode
notmuch notmuch
org-download org-download

View file

@ -2,5 +2,8 @@
services.openssh = { services.openssh = {
enable = true; enable = true;
permitRootLogin = "yes"; permitRootLogin = "yes";
forwardX11 = true;
}; };
programs.ssh.setXAuthLocation = true;
} }

View file

@ -31,7 +31,7 @@
wineWowPackages.full wineWowPackages.full
vial vial
deploy-rs.deploy-rs # to slow to cross compile for aarch64 deploy-rs.deploy-rs # to slow to cross compile for aarch64
digikam # broken digikam
] else [ ]) ] else [ ])
else [ ]); else [ ]);
}; };

View file

@ -35,7 +35,7 @@
}; };
in in
with pkgs; [ with pkgs; [
silver-searcher delta
fd fd
graphviz-nox graphviz-nox
hunspell hunspell
@ -47,6 +47,7 @@
poppler_utils poppler_utils
python3Full python3Full
rnix-lsp rnix-lsp
silver-searcher
stylish-haskell stylish-haskell
unzip unzip
( (

View file

@ -10,11 +10,10 @@
) )
(use-package fira-code-mode (use-package fira-code-mode
:after all-the-icons
;;:custom (fira-code-mode-disabled-ligatures '("x")) ;; List of ligatures to turn off ;;:custom (fira-code-mode-disabled-ligatures '("x")) ;; List of ligatures to turn off
:config (progn :config
(global-fira-code-mode) :hook ((prog-mode . (lambda () (progn (fira-code-mode) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))))))
;;TODO: why a timer is needed? It shouldn't
(run-at-time "30 sec" nil #'set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")))
(use-package visual-fill-column (use-package visual-fill-column
:commands (visual-fill-column-mode) :commands (visual-fill-column-mode)

View file

@ -2,6 +2,9 @@
:bind (("C-x g" . magit-status) :bind (("C-x g" . magit-status)
("C-x C-g" . magit-status))) ("C-x C-g" . magit-status)))
(use-package magit-delta
:hook (magit-mode . magit-delta-mode))
(use-package transient (use-package transient
:defer t :defer t
:config :config

View file

@ -0,0 +1,34 @@
(use-package go-translate
:config
(defclass gts-insert-render (gts-render) ())
(cl-defmethod gts-out ((_ gts-insert-render) task)
(deactivate-mark)
(insert (oref task result)))
(setq gts-translate-list '(("it" "en")))
(setq gts-default-translator
(gts-translator
:picker
(gts-prompt-picker)
:engines
(gts-google-engine :parser (gts-google-summary-parser))
:render
(gts-insert-render)
))
(defun gts-pop-definition ()
(interactive)
(gts-translate (gts-translator
:picker
(gts-noprompt-picker :texter (gts-current-or-selection-texter) :single t)
:engines
(gts-google-engine)
:render
(gts-posframe-pop-render)
)))
:bind
(("C-c t t" . gts-do-translate)
("C-c t p" . gts-pop-definition)))
(provide 'config-translate)

View file

@ -27,5 +27,6 @@ Return nil if COMMAND is not found anywhere in `exec-path'."
(require 'config-nix) (require 'config-nix)
(require 'config-purescript) (require 'config-purescript)
(require 'config-scad) (require 'config-scad)
(require 'config-translate)
(server-start) (server-start)

View file

@ -8,10 +8,11 @@
no = "https://search.nixos.org/options?sort=relevance&type=options&query={}"; no = "https://search.nixos.org/options?sort=relevance&type=options&query={}";
g = "https://google.com/search?q={}"; g = "https://google.com/search?q={}";
git = "https://github.com/search?q={}"; git = "https://github.com/search?q={}";
y = "https://www.youtube.com/results?search_query={}";
}; };
keyBindings = { keyBindings = {
normal = { normal = {
"<Ctrl-V>" = "spawn mpv {url}"; "<Ctrl-V>" = "spawn mpv --force-window=immediate {url}";
",l" = ''config-cycle spellcheck.languages [" it-IT "] [" en-US "]''; ",l" = ''config-cycle spellcheck.languages [" it-IT "] [" en-US "]'';
"<z><l>" = "spawn --userscript qute-pass --dmenu-invocation 'fuzzel -d'"; "<z><l>" = "spawn --userscript qute-pass --dmenu-invocation 'fuzzel -d'";
"<z><u><l>" = "spawn --userscript qute-pass --dmenu-invocation 'fuzzel -d' --username-only"; "<z><u><l>" = "spawn --userscript qute-pass --dmenu-invocation 'fuzzel -d' --username-only";