Format the entire project.
This commit is contained in:
parent
1dc50ae17d
commit
6f9db5e3a4
115 changed files with 3451 additions and 2901 deletions
|
@ -1,9 +1,12 @@
|
|||
# Programms I'm likely to want on every machine and/or may execute as root
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.base.pkgs = with pkgs; [
|
||||
age sops
|
||||
age
|
||||
sops
|
||||
bat
|
||||
ccze
|
||||
cryptsetup
|
||||
|
@ -54,7 +57,8 @@
|
|||
whois
|
||||
wirelesstools
|
||||
wpa_supplicant
|
||||
zip unzipNLS
|
||||
zip
|
||||
unzipNLS
|
||||
zlib
|
||||
zsh
|
||||
];
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.cpp.pkgs = with pkgs; [
|
||||
clang
|
||||
cmake
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.dict.pkgs = with pkgs; [
|
||||
translate-shell
|
||||
( hunspellWithDicts (with pkgs.hunspellDicts; [ de-de en-us ] ))
|
||||
( aspellWithDicts (d: with d; [ de en en-computers en-science ] ))
|
||||
(hunspellWithDicts (with pkgs.hunspellDicts; [de-de en-us]))
|
||||
(aspellWithDicts (d: with d; [de en en-computers en-science]))
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,16 +1,24 @@
|
|||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
modefiles = fn.lst { p = (toString ./emacs); b = true; };
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
fn,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
modefiles = fn.lst {
|
||||
p = toString ./emacs;
|
||||
b = true;
|
||||
};
|
||||
in rec {
|
||||
imports = [
|
||||
../options/emacs-init.nix
|
||||
] ++ modefiles;
|
||||
imports =
|
||||
[
|
||||
../options/emacs-init.nix
|
||||
]
|
||||
++ modefiles;
|
||||
|
||||
programs.emacs.init = {
|
||||
enable = (elem "emacs" config.machine.pkgs);
|
||||
enable = elem "emacs" config.machine.pkgs;
|
||||
recommendedGcSettings = true;
|
||||
|
||||
prelude = ''
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
# Source: https://github.com/Henry/dot-emacs/blob/master/my-lisp/company-pcomplete.el
|
||||
company-pcomplete = pkgs.writeText "company-pcomplete.el" ''
|
||||
;;; company-pcomplete.el --- company-mode pcomplete backend -*- lexical-binding: t -*-
|
||||
|
@ -95,77 +97,80 @@ let
|
|||
|
||||
(provide 'company-pcomplete)
|
||||
'';
|
||||
in mkIf (elem "emacs::company" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
company = {
|
||||
enable = true;
|
||||
package = epkgs: [ epkgs.company epkgs.company-web ];
|
||||
diminish = [ "company-mode" ];
|
||||
hook = [ "(after-init . global-company-mode)" ]
|
||||
++ optional (elem "emacs::rust" config.machine.pkgs)
|
||||
''(rust-mode . (lambda () (setq company-backends '((company-capf :with company-yasnippet)))))''
|
||||
++ optional (elem "emacs::web-mode" config.machine.pkgs)
|
||||
''(web-mode . (lambda () (set (make-local-variable 'company-backends) '(company-web-html company-css))
|
||||
(company-mode t)))'';
|
||||
bind = { "\t" = "'company-complete-common"; };
|
||||
init = ''(require 'ffap)'';
|
||||
config = ''
|
||||
;; (setq company-tooltip-align-annotations t)
|
||||
(setq company-idle-delay 0.3
|
||||
company-show-numbers t)
|
||||
in
|
||||
mkIf (elem "emacs::company" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
company = {
|
||||
enable = true;
|
||||
package = epkgs: [epkgs.company epkgs.company-web];
|
||||
diminish = ["company-mode"];
|
||||
hook =
|
||||
["(after-init . global-company-mode)"]
|
||||
++ optional (elem "emacs::rust" config.machine.pkgs)
|
||||
''(rust-mode . (lambda () (setq company-backends '((company-capf :with company-yasnippet)))))''
|
||||
++ optional (elem "emacs::web-mode" config.machine.pkgs)
|
||||
'' (web-mode . (lambda () (set (make-local-variable 'company-backends) '(company-web-html company-css))
|
||||
(company-mode t)))'';
|
||||
bind = {"\t" = "'company-complete-common";};
|
||||
init = ''(require 'ffap)'';
|
||||
config = ''
|
||||
;; (setq company-tooltip-align-annotations t)
|
||||
(setq company-idle-delay 0.3
|
||||
company-show-numbers t)
|
||||
|
||||
${optionalString
|
||||
(elem "emacs::org" config.machine.pkgs) ''
|
||||
(load-file "${company-pcomplete}")''
|
||||
}
|
||||
'';
|
||||
extraConfig = ''
|
||||
:bind (:map company-mode-map
|
||||
([remap completion-at-point] . company-complete-common)
|
||||
([remap complete-symbol] . company-complete-common))
|
||||
'';
|
||||
${
|
||||
optionalString
|
||||
(elem "emacs::org" config.machine.pkgs) ''
|
||||
(load-file "${company-pcomplete}")''
|
||||
}
|
||||
'';
|
||||
extraConfig = ''
|
||||
:bind (:map company-mode-map
|
||||
([remap completion-at-point] . company-complete-common)
|
||||
([remap complete-symbol] . company-complete-common))
|
||||
'';
|
||||
};
|
||||
|
||||
company-box = {
|
||||
enable = true;
|
||||
hook = ["(company-mode . (lambda () (company-box-mode)))"];
|
||||
config = ''
|
||||
(setq company-box-icons-alist 'company-box-icons-all-the-icons)
|
||||
|
||||
|
||||
(setq company-box-icons-lsp
|
||||
`(( 1 . ,(all-the-icons-faicon "file-text-o" :v-adjust -0.0575)) ; Text
|
||||
( 2 . ,(all-the-icons-faicon "cube" :v-adjust -0.0575)) ; Method
|
||||
( 3 . ,(all-the-icons-faicon "cube" :v-adjust -0.0575)) ; Function
|
||||
( 4 . ,(all-the-icons-faicon "cube" :v-adjust -0.0575)) ; Constructor
|
||||
( 5 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Field
|
||||
( 6 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Variable
|
||||
( 7 . ,(all-the-icons-faicon "cog" :v-adjust -0.0575)) ; Class
|
||||
( 8 . ,(all-the-icons-faicon "cogs" :v-adjust -0.0575)) ; Interface
|
||||
( 9 . ,(all-the-icons-alltheicon "less")) ; Module
|
||||
(10 . ,(all-the-icons-faicon "wrench" :v-adjust -0.0575)) ; Property
|
||||
(11 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Unit
|
||||
(12 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Value
|
||||
(13 . ,(all-the-icons-material "content_copy" :v-adjust -0.2)) ; Enum
|
||||
(14 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Keyword
|
||||
(15 . ,(all-the-icons-material "content_paste" :v-adjust -0.2)) ; Snippet
|
||||
(16 . ,(all-the-icons-material "palette" :v-adjust -0.2)) ; Color
|
||||
(17 . ,(all-the-icons-faicon "file" :v-adjust -0.0575)) ; File
|
||||
(18 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Reference
|
||||
(19 . ,(all-the-icons-faicon "folder" :v-adjust -0.0575)) ; Folder
|
||||
(20 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; EnumMember
|
||||
(21 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Constant
|
||||
(22 . ,(all-the-icons-faicon "cog" :v-adjust -0.0575)) ; Struct
|
||||
(23 . ,(all-the-icons-faicon "bolt" :v-adjust -0.0575)) ; Event
|
||||
(24 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Operator
|
||||
(25 . ,(all-the-icons-faicon "cog" :v-adjust -0.0575)) ; TypeParameter
|
||||
))
|
||||
'';
|
||||
};
|
||||
all-the-icons = {enable = true;};
|
||||
company-jedi = {
|
||||
enable = elem "emacs::elpy" config.machine.pkgs;
|
||||
};
|
||||
};
|
||||
|
||||
company-box = {
|
||||
enable = true;
|
||||
hook = [ "(company-mode . (lambda () (company-box-mode)))" ];
|
||||
config = ''
|
||||
(setq company-box-icons-alist 'company-box-icons-all-the-icons)
|
||||
|
||||
|
||||
(setq company-box-icons-lsp
|
||||
`(( 1 . ,(all-the-icons-faicon "file-text-o" :v-adjust -0.0575)) ; Text
|
||||
( 2 . ,(all-the-icons-faicon "cube" :v-adjust -0.0575)) ; Method
|
||||
( 3 . ,(all-the-icons-faicon "cube" :v-adjust -0.0575)) ; Function
|
||||
( 4 . ,(all-the-icons-faicon "cube" :v-adjust -0.0575)) ; Constructor
|
||||
( 5 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Field
|
||||
( 6 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Variable
|
||||
( 7 . ,(all-the-icons-faicon "cog" :v-adjust -0.0575)) ; Class
|
||||
( 8 . ,(all-the-icons-faicon "cogs" :v-adjust -0.0575)) ; Interface
|
||||
( 9 . ,(all-the-icons-alltheicon "less")) ; Module
|
||||
(10 . ,(all-the-icons-faicon "wrench" :v-adjust -0.0575)) ; Property
|
||||
(11 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Unit
|
||||
(12 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Value
|
||||
(13 . ,(all-the-icons-material "content_copy" :v-adjust -0.2)) ; Enum
|
||||
(14 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Keyword
|
||||
(15 . ,(all-the-icons-material "content_paste" :v-adjust -0.2)) ; Snippet
|
||||
(16 . ,(all-the-icons-material "palette" :v-adjust -0.2)) ; Color
|
||||
(17 . ,(all-the-icons-faicon "file" :v-adjust -0.0575)) ; File
|
||||
(18 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Reference
|
||||
(19 . ,(all-the-icons-faicon "folder" :v-adjust -0.0575)) ; Folder
|
||||
(20 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; EnumMember
|
||||
(21 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Constant
|
||||
(22 . ,(all-the-icons-faicon "cog" :v-adjust -0.0575)) ; Struct
|
||||
(23 . ,(all-the-icons-faicon "bolt" :v-adjust -0.0575)) ; Event
|
||||
(24 . ,(all-the-icons-faicon "tag" :v-adjust -0.0575)) ; Operator
|
||||
(25 . ,(all-the-icons-faicon "cog" :v-adjust -0.0575)) ; TypeParameter
|
||||
))
|
||||
'';
|
||||
};
|
||||
all-the-icons = { enable = true; };
|
||||
company-jedi = {
|
||||
enable = (elem "emacs::elpy" config.machine.pkgs);
|
||||
};
|
||||
};
|
||||
fonts.packages = pkgs.emacs-all-the-icons-fonts.all;
|
||||
}
|
||||
fonts.packages = pkgs.emacs-all-the-icons-fonts.all;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::direnv" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.direnv = {
|
||||
enable = true;
|
||||
config = ''(direnv-mode)'';
|
||||
};
|
||||
services.lorri.enable = true;
|
||||
environment.systemPackages = with pkgs; [ lorri direnv ];
|
||||
}
|
||||
mkIf (elem "emacs::direnv" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.direnv = {
|
||||
enable = true;
|
||||
config = ''(direnv-mode)'';
|
||||
};
|
||||
services.lorri.enable = true;
|
||||
environment.systemPackages = with pkgs; [lorri direnv];
|
||||
}
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::docker" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
dockerfile-mode = {
|
||||
enable = true;
|
||||
mkIf (elem "emacs::docker" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
dockerfile-mode = {
|
||||
enable = true;
|
||||
};
|
||||
docker = {
|
||||
enable = true;
|
||||
};
|
||||
docker-compose-mode = {
|
||||
enable = true;
|
||||
};
|
||||
docker-tramp = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
docker = {
|
||||
enable = true;
|
||||
};
|
||||
docker-compose-mode = {
|
||||
enable = true;
|
||||
};
|
||||
docker-tramp = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::dockerfile" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.dockerfile-mode = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
mkIf (elem "emacs::dockerfile" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.dockerfile-mode = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::doom-modeline" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.doom-modeline = {
|
||||
enable = true;
|
||||
hook = ["(after-init . doom-modeline-mode)"];
|
||||
config = ''
|
||||
(setq doom-modeline-icon t)
|
||||
(setq doom-modeline-height 25)
|
||||
(setq doom-modeline-bar-width 3)
|
||||
;; The default priority of detection is `ffip' > `projectile' > `project'.
|
||||
(setq doom-modeline-project-detection 'project)
|
||||
(setq doom-modeline-buffer-file-name-style 'truncate-upto-project)
|
||||
(setq doom-modeline-unicode-fallback nil)
|
||||
|
||||
mkIf (elem "emacs::doom-modeline" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.doom-modeline = {
|
||||
enable = true;
|
||||
hook = [ "(after-init . doom-modeline-mode)" ];
|
||||
config = ''
|
||||
(setq doom-modeline-icon t)
|
||||
(setq doom-modeline-height 25)
|
||||
(setq doom-modeline-bar-width 3)
|
||||
;; The default priority of detection is `ffip' > `projectile' > `project'.
|
||||
(setq doom-modeline-project-detection 'project)
|
||||
(setq doom-modeline-buffer-file-name-style 'truncate-upto-project)
|
||||
(setq doom-modeline-unicode-fallback nil)
|
||||
|
||||
(setq doom-modeline--battery-status t)
|
||||
'';
|
||||
};
|
||||
}
|
||||
(setq doom-modeline--battery-status t)
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::doom-themes" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.doom-themes = {
|
||||
enable = true;
|
||||
config = ''
|
||||
;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each theme
|
||||
;; may have their own settings.
|
||||
(load-theme 'doom-solarized-dark t)
|
||||
|
||||
mkIf (elem "emacs::doom-themes" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.doom-themes = {
|
||||
enable = true;
|
||||
config = ''
|
||||
;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each theme
|
||||
;; may have their own settings.
|
||||
(load-theme 'doom-solarized-dark t)
|
||||
|
||||
;; ${optionalString (elem "emacs::org" config.machine.pkgs) "(doom-themes-org-config)"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
;; ${optionalString (elem "emacs::org" config.machine.pkgs) "(doom-themes-org-config)"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,148 +1,151 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::elfeed" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
elfeed = let
|
||||
pyEnv = pkgs.python3.withPackages (ps: with ps; [beautifulsoup4 lxml requests]);
|
||||
pyScript = pkgs.writeScript "elfeedFetcher.py" ''
|
||||
#!${pyEnv}/bin/python3
|
||||
import sys
|
||||
from requests import get
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
mkIf (elem "emacs::elfeed" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
elfeed = let
|
||||
pyEnv = pkgs.python3.withPackages (ps: with ps; [ beautifulsoup4 lxml requests ]);
|
||||
pyScript = pkgs.writeScript "elfeedFetcher.py" ''
|
||||
#!${pyEnv}/bin/python3
|
||||
import sys
|
||||
from requests import get
|
||||
from bs4 import BeautifulSoup
|
||||
header_agent = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0'}
|
||||
with get(sys.argv[1], headers=header_agent) as r:
|
||||
soup = BeautifulSoup(r.text, 'lxml')
|
||||
abstract = soup.find('dd', {"id": "abstract"}).text.replace('"', '\\"')
|
||||
article = '\n\n'.join(
|
||||
[soup.find('p', {"id": "first"}, class_="lead").text] +
|
||||
[
|
||||
p.text for p in
|
||||
soup.find('div', {"id": "text"}).findAll('p')
|
||||
]).replace('"', '\\"')
|
||||
print(f"(setq abstract \"{abstract}\") (setq article \"{article}\")")
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
hook = [''(elfeed-new-entry . elfeed-content-fetcher)''];
|
||||
config = ''
|
||||
(load-file "~/.emacs.d/elfeed.el")
|
||||
|
||||
header_agent = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0'}
|
||||
with get(sys.argv[1], headers=header_agent) as r:
|
||||
soup = BeautifulSoup(r.text, 'lxml')
|
||||
abstract = soup.find('dd', {"id": "abstract"}).text.replace('"', '\\"')
|
||||
article = '\n\n'.join(
|
||||
[soup.find('p', {"id": "first"}, class_="lead").text] +
|
||||
[
|
||||
p.text for p in
|
||||
soup.find('div', {"id": "text"}).findAll('p')
|
||||
]).replace('"', '\\"')
|
||||
print(f"(setq abstract \"{abstract}\") (setq article \"{article}\")")
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
hook = [ ''(elfeed-new-entry . elfeed-content-fetcher)'' ];
|
||||
config = ''
|
||||
(load-file "~/.emacs.d/elfeed.el")
|
||||
(defun elfeed-play-with-mpv (entry)
|
||||
"Play entry link with mpv."
|
||||
(interactive (elfeed-search-selected :single))
|
||||
(start-process "elfeed-mpv" nil "mpv" "--ytdl-format=[height<=1080]" (elfeed-entry-link entry)))
|
||||
|
||||
(defun elfeed-play-with-mpv (entry)
|
||||
"Play entry link with mpv."
|
||||
(interactive (elfeed-search-selected :single))
|
||||
(start-process "elfeed-mpv" nil "mpv" "--ytdl-format=[height<=1080]" (elfeed-entry-link entry)))
|
||||
(defun elfeed-search-show-entry-custom (entry)
|
||||
"Custom actions for various sources."
|
||||
(interactive (list (elfeed-search-selected :ignore-region)))
|
||||
(if (equal (car (elfeed-entry-id entry)) "www.youtube.com") (elfeed-play-with-mpv entry)
|
||||
(elfeed-show-entry entry)))
|
||||
(define-key elfeed-search-mode-map [remap elfeed-search-show-entry] 'elfeed-search-show-entry-custom)
|
||||
|
||||
(defun elfeed-search-show-entry-custom (entry)
|
||||
"Custom actions for various sources."
|
||||
(interactive (list (elfeed-search-selected :ignore-region)))
|
||||
(if (equal (car (elfeed-entry-id entry)) "www.youtube.com") (elfeed-play-with-mpv entry)
|
||||
(elfeed-show-entry entry)))
|
||||
(define-key elfeed-search-mode-map [remap elfeed-search-show-entry] 'elfeed-search-show-entry-custom)
|
||||
(defun elfeed-get-yt-description (url)
|
||||
(shell-command-to-string (format "${pkgs.youtube-dl}/bin/youtube-dl --get-description \"%s\" 2> /dev/null" url)))
|
||||
|
||||
(defun elfeed-get-yt-description (url)
|
||||
(shell-command-to-string (format "${pkgs.youtube-dl}/bin/youtube-dl --get-description \"%s\" 2> /dev/null" url)))
|
||||
(defun elfeed-get-sd-article (url)
|
||||
(eval-string (shell-command-to-string (format "${pyEnv}/bin/python3 ${pyScript} \"%s\" 2> /dev/null" url))))
|
||||
|
||||
(defun elfeed-get-sd-article (url)
|
||||
(eval-string (shell-command-to-string (format "${pyEnv}/bin/python3 ${pyScript} \"%s\" 2> /dev/null" url))))
|
||||
(defun eval-string (string)
|
||||
(eval (car (read-from-string (format "(progn %s)" string)))))
|
||||
|
||||
(defun eval-string (string)
|
||||
(eval (car (read-from-string (format "(progn %s)" string)))))
|
||||
(defun elfeed-content-fetcher (entry)
|
||||
"Fetches content for various entries (currently only sciencedaily)."
|
||||
(interactive (list (elfeed-search-selected :ignore-region)))
|
||||
|
||||
(defun elfeed-content-fetcher (entry)
|
||||
"Fetches content for various entries (currently only sciencedaily)."
|
||||
(interactive (list (elfeed-search-selected :ignore-region)))
|
||||
(let ((url (elfeed-entry-link entry))
|
||||
(feed-id (elfeed-deref (elfeed-entry-feed-id entry)))
|
||||
)
|
||||
(when (equal (car (elfeed-entry-id entry)) "www.sciencedaily.com")
|
||||
(elfeed-get-sd-article (cdr (elfeed-entry-id entry)))
|
||||
;; (setf (elfeed-entry-content entry) (elfeed-ref article))
|
||||
(setf (elfeed-meta entry :content) (elfeed-ref article))
|
||||
(setf (elfeed-meta entry :abstract) abstract)
|
||||
(makunbound 'abstract)
|
||||
(makunbound 'article))))
|
||||
|
||||
(let ((url (elfeed-entry-link entry))
|
||||
(feed-id (elfeed-deref (elfeed-entry-feed-id entry)))
|
||||
)
|
||||
(when (equal (car (elfeed-entry-id entry)) "www.sciencedaily.com")
|
||||
(elfeed-get-sd-article (cdr (elfeed-entry-id entry)))
|
||||
;; (setf (elfeed-entry-content entry) (elfeed-ref article))
|
||||
(setf (elfeed-meta entry :content) (elfeed-ref article))
|
||||
(setf (elfeed-meta entry :abstract) abstract)
|
||||
(makunbound 'abstract)
|
||||
(makunbound 'article))))
|
||||
|
||||
(defun elfeed-show-refresh--mail-style ()
|
||||
"Update the buffer to match the selected entry, using a mail-style."
|
||||
(interactive)
|
||||
(let* ((inhibit-read-only t)
|
||||
(title (elfeed-entry-title elfeed-show-entry))
|
||||
(date (seconds-to-time (elfeed-entry-date elfeed-show-entry)))
|
||||
(authors (elfeed-meta elfeed-show-entry :authors))
|
||||
(link (elfeed-entry-link elfeed-show-entry))
|
||||
(tags (elfeed-entry-tags elfeed-show-entry))
|
||||
(tagsstr (mapconcat #'symbol-name tags ", "))
|
||||
(nicedate (format-time-string "%a, %e %b %Y %T %Z" date))
|
||||
(content (if (elfeed-meta elfeed-show-entry :content) (elfeed-deref (elfeed-meta elfeed-show-entry :content)) (elfeed-deref (elfeed-entry-content elfeed-show-entry))))
|
||||
(type (elfeed-entry-content-type elfeed-show-entry))
|
||||
(feed (elfeed-entry-feed elfeed-show-entry))
|
||||
(feed-title (elfeed-feed-title feed))
|
||||
(base (and feed (elfeed-compute-base (elfeed-feed-url feed)))))
|
||||
(erase-buffer)
|
||||
(insert (format (propertize "Title: %s\n" 'face 'message-header-name)
|
||||
(propertize title 'face 'message-header-subject)))
|
||||
(when elfeed-show-entry-author
|
||||
(dolist (author authors)
|
||||
(let ((formatted (elfeed--show-format-author author)))
|
||||
(insert
|
||||
(format (propertize "Author: %s\n" 'face 'message-header-name)
|
||||
(propertize formatted 'face 'message-header-to))))))
|
||||
(insert (format (propertize "Date: %s\n" 'face 'message-header-name)
|
||||
(propertize nicedate 'face 'message-header-other)))
|
||||
(insert (format (propertize "Feed: %s\n" 'face 'message-header-name)
|
||||
(propertize feed-title 'face 'message-header-other)))
|
||||
(when tags
|
||||
(insert (format (propertize "Tags: %s\n" 'face 'message-header-name)
|
||||
(propertize tagsstr 'face 'message-header-other))))
|
||||
(insert (propertize "Link: " 'face 'message-header-name))
|
||||
(elfeed-insert-link link link)
|
||||
(insert "\n")
|
||||
(cl-loop for enclosure in (elfeed-entry-enclosures elfeed-show-entry)
|
||||
do (insert (propertize "Enclosure: " 'face 'message-header-name))
|
||||
do (elfeed-insert-link (car enclosure))
|
||||
do (insert "\n"))
|
||||
(insert "\n")
|
||||
(if content
|
||||
(if (eq type 'html)
|
||||
(elfeed-insert-html content base)
|
||||
(insert content))
|
||||
(insert (propertize "(empty)\n" 'face 'italic)))
|
||||
(goto-char (point-min))))
|
||||
(defun elfeed-show-refresh--mail-style ()
|
||||
"Update the buffer to match the selected entry, using a mail-style."
|
||||
(interactive)
|
||||
(let* ((inhibit-read-only t)
|
||||
(title (elfeed-entry-title elfeed-show-entry))
|
||||
(date (seconds-to-time (elfeed-entry-date elfeed-show-entry)))
|
||||
(authors (elfeed-meta elfeed-show-entry :authors))
|
||||
(link (elfeed-entry-link elfeed-show-entry))
|
||||
(tags (elfeed-entry-tags elfeed-show-entry))
|
||||
(tagsstr (mapconcat #'symbol-name tags ", "))
|
||||
(nicedate (format-time-string "%a, %e %b %Y %T %Z" date))
|
||||
(content (if (elfeed-meta elfeed-show-entry :content) (elfeed-deref (elfeed-meta elfeed-show-entry :content)) (elfeed-deref (elfeed-entry-content elfeed-show-entry))))
|
||||
(type (elfeed-entry-content-type elfeed-show-entry))
|
||||
(feed (elfeed-entry-feed elfeed-show-entry))
|
||||
(feed-title (elfeed-feed-title feed))
|
||||
(base (and feed (elfeed-compute-base (elfeed-feed-url feed)))))
|
||||
(erase-buffer)
|
||||
(insert (format (propertize "Title: %s\n" 'face 'message-header-name)
|
||||
(propertize title 'face 'message-header-subject)))
|
||||
(when elfeed-show-entry-author
|
||||
(dolist (author authors)
|
||||
(let ((formatted (elfeed--show-format-author author)))
|
||||
(insert
|
||||
(format (propertize "Author: %s\n" 'face 'message-header-name)
|
||||
(propertize formatted 'face 'message-header-to))))))
|
||||
(insert (format (propertize "Date: %s\n" 'face 'message-header-name)
|
||||
(propertize nicedate 'face 'message-header-other)))
|
||||
(insert (format (propertize "Feed: %s\n" 'face 'message-header-name)
|
||||
(propertize feed-title 'face 'message-header-other)))
|
||||
(when tags
|
||||
(insert (format (propertize "Tags: %s\n" 'face 'message-header-name)
|
||||
(propertize tagsstr 'face 'message-header-other))))
|
||||
(insert (propertize "Link: " 'face 'message-header-name))
|
||||
(elfeed-insert-link link link)
|
||||
(insert "\n")
|
||||
(cl-loop for enclosure in (elfeed-entry-enclosures elfeed-show-entry)
|
||||
do (insert (propertize "Enclosure: " 'face 'message-header-name))
|
||||
do (elfeed-insert-link (car enclosure))
|
||||
do (insert "\n"))
|
||||
(insert "\n")
|
||||
(if content
|
||||
(if (eq type 'html)
|
||||
(elfeed-insert-html content base)
|
||||
(insert content))
|
||||
(insert (propertize "(empty)\n" 'face 'italic)))
|
||||
(goto-char (point-min))))
|
||||
|
||||
|
||||
(defun elfeed-db-gc (&optional stats-p)
|
||||
"Clean up unused content from the content database.
|
||||
If STATS is true, return the space cleared in bytes."
|
||||
(elfeed-db-gc-empty-feeds)
|
||||
(let* ((data (expand-file-name "data" elfeed-db-directory))
|
||||
(dirs (directory-files data t "^[0-9a-z]\\{2\\}$"))
|
||||
(ids (cl-mapcan (lambda (d) (directory-files d nil nil t)) dirs))
|
||||
(table (make-hash-table :test 'equal)))
|
||||
(dolist (id ids)
|
||||
(setf (gethash id table) nil))
|
||||
(with-elfeed-db-visit (entry _)
|
||||
(let ((content (elfeed-entry-content entry))
|
||||
(meta-content (elfeed-meta entry :content)))
|
||||
(when (elfeed-ref-p content)
|
||||
(setf (gethash (elfeed-ref-id content) table) t))
|
||||
(when (elfeed-ref-p (meta-content))
|
||||
(setf (gethash (elfeed-ref-id meta-content) table) t))))
|
||||
(cl-loop for id hash-keys of table using (hash-value used)
|
||||
for used-p = (or used (member id '("." "..")))
|
||||
when (and (not used-p) stats-p)
|
||||
sum (let* ((ref (elfeed-ref--create :id id))
|
||||
(file (elfeed-ref--file ref)))
|
||||
(* 1.0 (nth 7 (file-attributes file))))
|
||||
unless used-p
|
||||
do (elfeed-ref-delete (elfeed-ref--create :id id))
|
||||
finally (cl-loop for dir in dirs
|
||||
when (elfeed-directory-empty-p dir)
|
||||
do (delete-directory dir)))))
|
||||
'';
|
||||
(defun elfeed-db-gc (&optional stats-p)
|
||||
"Clean up unused content from the content database.
|
||||
If STATS is true, return the space cleared in bytes."
|
||||
(elfeed-db-gc-empty-feeds)
|
||||
(let* ((data (expand-file-name "data" elfeed-db-directory))
|
||||
(dirs (directory-files data t "^[0-9a-z]\\{2\\}$"))
|
||||
(ids (cl-mapcan (lambda (d) (directory-files d nil nil t)) dirs))
|
||||
(table (make-hash-table :test 'equal)))
|
||||
(dolist (id ids)
|
||||
(setf (gethash id table) nil))
|
||||
(with-elfeed-db-visit (entry _)
|
||||
(let ((content (elfeed-entry-content entry))
|
||||
(meta-content (elfeed-meta entry :content)))
|
||||
(when (elfeed-ref-p content)
|
||||
(setf (gethash (elfeed-ref-id content) table) t))
|
||||
(when (elfeed-ref-p (meta-content))
|
||||
(setf (gethash (elfeed-ref-id meta-content) table) t))))
|
||||
(cl-loop for id hash-keys of table using (hash-value used)
|
||||
for used-p = (or used (member id '("." "..")))
|
||||
when (and (not used-p) stats-p)
|
||||
sum (let* ((ref (elfeed-ref--create :id id))
|
||||
(file (elfeed-ref--file ref)))
|
||||
(* 1.0 (nth 7 (file-attributes file))))
|
||||
unless used-p
|
||||
do (elfeed-ref-delete (elfeed-ref--create :id id))
|
||||
finally (cl-loop for dir in dirs
|
||||
when (elfeed-directory-empty-p dir)
|
||||
do (delete-directory dir)))))
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,43 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::elpy" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.elpy = {
|
||||
enable = true;
|
||||
after = ["python"];
|
||||
command = ["elpy-enable"];
|
||||
hook =
|
||||
[
|
||||
''
|
||||
(elpy-mode
|
||||
. (lambda ()
|
||||
(set (make-local-variable 'company-backends)
|
||||
'((company-dabbrev-code company-yasnippet elpy-company-backend)))))
|
||||
''
|
||||
]
|
||||
++ (optional (elem "emacs::flyspell" config.machine.pkgs) "(elpy-mode . (lambda () (flyspell-prog-mode)))")
|
||||
++ (optional (elem "emacs::flycheck" config.machine.pkgs) "(elpy-mode . (lambda () (flycheck-mode)))");
|
||||
bindLocal = {
|
||||
elpy-mode-map = {
|
||||
"<tab>" = "company-indent-or-complete-common";
|
||||
};
|
||||
};
|
||||
init = ''(with-eval-after-load 'python (elpy-enable))'';
|
||||
config = ''
|
||||
(setq elpy-project-root-finder-functions '(elpy-project-find-git-root elpy-project-find-python-root elpy-project-find-hg-root elpy-project-find-svn-root))
|
||||
(setq elpy-rpc-backend "jedi")
|
||||
(setq python-shell-interpreter "ipython"
|
||||
python-shell-interpreter-args "-i --simple-prompt")
|
||||
|
||||
mkIf (elem "emacs::elpy" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.elpy = {
|
||||
enable = true;
|
||||
after = [ "python" ];
|
||||
command = [ "elpy-enable" ];
|
||||
hook = [ ''
|
||||
(elpy-mode
|
||||
. (lambda ()
|
||||
(set (make-local-variable 'company-backends)
|
||||
'((company-dabbrev-code company-yasnippet elpy-company-backend)))))
|
||||
'' ]
|
||||
++ (optional (elem "emacs::flyspell" config.machine.pkgs) "(elpy-mode . (lambda () (flyspell-prog-mode)))")
|
||||
++ (optional (elem "emacs::flycheck" config.machine.pkgs) "(elpy-mode . (lambda () (flycheck-mode)))");
|
||||
bindLocal = { elpy-mode-map = {
|
||||
"<tab>" = "company-indent-or-complete-common";
|
||||
};};
|
||||
init = ''(with-eval-after-load 'python (elpy-enable))'';
|
||||
config = ''
|
||||
(setq elpy-project-root-finder-functions '(elpy-project-find-git-root elpy-project-find-python-root elpy-project-find-hg-root elpy-project-find-svn-root))
|
||||
(setq elpy-rpc-backend "jedi")
|
||||
(setq python-shell-interpreter "ipython"
|
||||
python-shell-interpreter-args "-i --simple-prompt")
|
||||
|
||||
${optionalString (elem "emacs::flycheck" config.machine.pkgs) ''
|
||||
;; manually set what python-mypy is and configure it to ignore 3rd party imports
|
||||
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
|
||||
(setq-default flycheck-checker 'python-pylint)
|
||||
(flycheck-add-next-checker 'python-pylint 'python-flake8 t)
|
||||
;; (flycheck-add-next-checker 'python-mypy 'python-flake8 t)''}
|
||||
'';
|
||||
};
|
||||
}
|
||||
${optionalString (elem "emacs::flycheck" config.machine.pkgs) ''
|
||||
;; manually set what python-mypy is and configure it to ignore 3rd party imports
|
||||
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
|
||||
(setq-default flycheck-checker 'python-pylint)
|
||||
(flycheck-add-next-checker 'python-pylint 'python-flake8 t)
|
||||
;; (flycheck-add-next-checker 'python-mypy 'python-flake8 t)''}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::fcitx" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
fcitx = {
|
||||
enable = true;
|
||||
demand = true;
|
||||
config = ''
|
||||
;; (setq fcitx-use-dbus t)
|
||||
(fcitx-default-setup)
|
||||
'';
|
||||
mkIf (elem "emacs::fcitx" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
fcitx = {
|
||||
enable = true;
|
||||
demand = true;
|
||||
config = ''
|
||||
;; (setq fcitx-use-dbus t)
|
||||
(fcitx-default-setup)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,37 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::flycheck" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.flycheck = {
|
||||
enable = true;
|
||||
command = ["global-flycheck-mode"];
|
||||
defer = 1;
|
||||
bind = {};
|
||||
config = ''
|
||||
|
||||
mkIf (elem "emacs::flycheck" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.flycheck = {
|
||||
enable = true;
|
||||
command = [ "global-flycheck-mode" ];
|
||||
defer = 1;
|
||||
bind = {};
|
||||
config = ''
|
||||
'';
|
||||
};
|
||||
|
||||
'';
|
||||
};
|
||||
programs.emacs.init.usePackage.flycheck-haskell = {
|
||||
enable = elem "emacs::haskell" config.machine.pkgs;
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.flycheck-haskell = {
|
||||
enable = (elem "emacs::haskell" config.machine.pkgs);
|
||||
};
|
||||
programs.emacs.init.usePackage.flycheck-irony = {
|
||||
enable = elem "emacs::irony" config.machine.pkgs;
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.flycheck-irony = {
|
||||
enable = (elem "emacs::irony" config.machine.pkgs);
|
||||
};
|
||||
programs.emacs.init.usePackage.flycheck-mypy = {
|
||||
enable = elem "emacs::elpy" config.machine.pkgs;
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.flycheck-mypy = {
|
||||
enable = (elem "emacs::elpy" config.machine.pkgs);
|
||||
};
|
||||
programs.emacs.init.usePackage.pylint = {
|
||||
enable = elem "emacs::elpy" config.machine.pkgs;
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.pylint = {
|
||||
enable = (elem "emacs::elpy" config.machine.pkgs);
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.flycheck-rust = {
|
||||
enable = (elem "emacs::rust" config.machine.pkgs);
|
||||
};
|
||||
}
|
||||
programs.emacs.init.usePackage.flycheck-rust = {
|
||||
enable = elem "emacs::rust" config.machine.pkgs;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,31 +1,33 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::flyspell" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.flyspell = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
diminish = ["flyspell-mode"];
|
||||
command = ["flyspell-mode" "flyspell-prog-mode"];
|
||||
hook = [];
|
||||
bind = {
|
||||
"C-M-<tab>" = "flyspell-switch-dictionary";
|
||||
"C-c f" = "ispell-word";
|
||||
};
|
||||
config = ''
|
||||
;; Make flyspell less verbose and disable annoying keybind
|
||||
(setq flyspell-issue-message-flag nil
|
||||
flyspell-issue-welcome-flag nil
|
||||
flyspell-use-meta-tab nil)
|
||||
|
||||
mkIf (elem "emacs::flyspell" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.flyspell = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
diminish = [ "flyspell-mode" ];
|
||||
command = [ "flyspell-mode" "flyspell-prog-mode" ];
|
||||
hook = [];
|
||||
bind = {
|
||||
"C-M-<tab>" = "flyspell-switch-dictionary";
|
||||
"C-c f" = "ispell-word";
|
||||
(defun flyspell-switch-dictionary ()
|
||||
(interactive)
|
||||
(let* ((dic ispell-current-dictionary)
|
||||
(change (if (string= dic "deutsch8") "english" "deutsch8")))
|
||||
(ispell-change-dictionary change)
|
||||
(message "Dictionary switched to %s" change)
|
||||
))
|
||||
'';
|
||||
};
|
||||
config = ''
|
||||
;; Make flyspell less verbose and disable annoying keybind
|
||||
(setq flyspell-issue-message-flag nil
|
||||
flyspell-issue-welcome-flag nil
|
||||
flyspell-use-meta-tab nil)
|
||||
|
||||
(defun flyspell-switch-dictionary ()
|
||||
(interactive)
|
||||
(let* ((dic ispell-current-dictionary)
|
||||
(change (if (string= dic "deutsch8") "english" "deutsch8")))
|
||||
(ispell-change-dictionary change)
|
||||
(message "Dictionary switched to %s" change)
|
||||
))
|
||||
'';
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::latex" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
latex-mode = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
defer = true;
|
||||
};
|
||||
|
||||
mkIf (elem "emacs::latex" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
latex-mode = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
defer = true;
|
||||
};
|
||||
tex-site = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
package = epkgs: epkgs.auctex;
|
||||
hook = [];
|
||||
mode = [''("\\.tex\\'" . TeX-latex-mode)''];
|
||||
};
|
||||
|
||||
tex-site = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
package = epkgs: epkgs.auctex;
|
||||
hook = [];
|
||||
mode = [ ''("\\.tex\\'" . TeX-latex-mode)'' ];
|
||||
preview = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
package = epkgs: epkgs.auctex;
|
||||
};
|
||||
};
|
||||
|
||||
preview = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
package = epkgs: epkgs.auctex;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,56 +1,60 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::lsp" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
lsp-mode = {
|
||||
enable = true;
|
||||
command = ["lsp-mode"];
|
||||
config = ''
|
||||
(setq lsp-keymap-prefix "C-c")
|
||||
(setq lsp-eldoc-render-all nil)
|
||||
|
||||
mkIf (elem "emacs::lsp" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
lsp-mode = {
|
||||
enable = true;
|
||||
command = [ "lsp-mode" ];
|
||||
config = ''
|
||||
(setq lsp-keymap-prefix "C-c")
|
||||
(setq lsp-eldoc-render-all nil)
|
||||
|
||||
(defvar lsp-language-id-configuration '(
|
||||
${optionalString (elem "emacs::rust" config.machine.pkgs)
|
||||
(defvar lsp-language-id-configuration '(
|
||||
${optionalString (elem "emacs::rust" config.machine.pkgs)
|
||||
''(rust-mode . "rust")''}
|
||||
))
|
||||
${optionalString (elem "emacs::rust" config.machine.pkgs) ''
|
||||
(setq lsp-rust-clippy-preference "on")
|
||||
''}
|
||||
${optionalString (elem "emacs::web-mode" config.machine.pkgs) ''
|
||||
(setq lsp-clients-deno-enable-unstable 't)
|
||||
(setq lsp-clients-deno-import-map "./import_map.json")
|
||||
(setq lsp-clients-deno-config "./deno.json")
|
||||
''}
|
||||
${optionalString (elem "emacs::php-mode" config.machine.pkgs) ''
|
||||
(setq lsp-intelephense-php-version "8.2")
|
||||
(setq lsp-intelephense-server-command `("${pkgs.nodePackages.intelephense}/bin/intelephense" "--stdio"))
|
||||
''}
|
||||
'';
|
||||
};
|
||||
))
|
||||
${optionalString (elem "emacs::rust" config.machine.pkgs) ''
|
||||
(setq lsp-rust-clippy-preference "on")
|
||||
''}
|
||||
${optionalString (elem "emacs::web-mode" config.machine.pkgs) ''
|
||||
(setq lsp-clients-deno-enable-unstable 't)
|
||||
(setq lsp-clients-deno-import-map "./import_map.json")
|
||||
(setq lsp-clients-deno-config "./deno.json")
|
||||
''}
|
||||
${optionalString (elem "emacs::php-mode" config.machine.pkgs) ''
|
||||
(setq lsp-intelephense-php-version "8.2")
|
||||
(setq lsp-intelephense-server-command `("${pkgs.nodePackages.intelephense}/bin/intelephense" "--stdio"))
|
||||
''}
|
||||
'';
|
||||
};
|
||||
|
||||
lsp-ui = {
|
||||
enable = true;
|
||||
after = [ "lsp-mode" ];
|
||||
config = ''
|
||||
(setq lsp-ui-sideline-enable 't)
|
||||
(setq lsp-ui-sideline-show-symbol nil)
|
||||
(setq lsp-ui-sideline-show-hover nil)
|
||||
(setq lsp-ui-doc-show-with-cursor 't)
|
||||
(setq lsp-ui-doc-delay 1)
|
||||
(setq lsp-ui-sideline-show-code-actions 't)
|
||||
(setq lsp-ui-sideline-update-mode 'point)
|
||||
(define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
|
||||
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)
|
||||
'';
|
||||
};
|
||||
lsp-ui = {
|
||||
enable = true;
|
||||
after = ["lsp-mode"];
|
||||
config = ''
|
||||
(setq lsp-ui-sideline-enable 't)
|
||||
(setq lsp-ui-sideline-show-symbol nil)
|
||||
(setq lsp-ui-sideline-show-hover nil)
|
||||
(setq lsp-ui-doc-show-with-cursor 't)
|
||||
(setq lsp-ui-doc-delay 1)
|
||||
(setq lsp-ui-sideline-show-code-actions 't)
|
||||
(setq lsp-ui-sideline-update-mode 'point)
|
||||
(define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
|
||||
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)
|
||||
'';
|
||||
};
|
||||
|
||||
lsp-ui-flycheck = {
|
||||
enable = true;
|
||||
package = epkgs: [ epkgs.lsp-ui ];
|
||||
after = [ "lsp-ui" ]
|
||||
++ optional (elem "emacs::flycheck" config.machine.pkgs) "flycheck";
|
||||
lsp-ui-flycheck = {
|
||||
enable = true;
|
||||
package = epkgs: [epkgs.lsp-ui];
|
||||
after =
|
||||
["lsp-ui"]
|
||||
++ optional (elem "emacs::flycheck" config.machine.pkgs) "flycheck";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::magit" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.magit = {
|
||||
enable = true;
|
||||
bind = {
|
||||
"C-c m" = "magit-status";
|
||||
mkIf (elem "emacs::magit" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.magit = {
|
||||
enable = true;
|
||||
bind = {
|
||||
"C-c m" = "magit-status";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
defaultEncrypt = pkgs.emacsPackages.trivialBuild rec {
|
||||
pname = "defaultencrypt";
|
||||
version = "ba07acc8e9fd692534c39c7cdad0a19dc0d897d9";
|
||||
|
@ -14,106 +16,107 @@ let
|
|||
sha256 = "1ln7h1syx7yi7bqvirv90mk4rvwxg4zm1wvfcvhfh64s3hqrbfgl";
|
||||
};
|
||||
};
|
||||
in mkIf (elem "emacs::mu4e" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.pinentry = {
|
||||
enable = true;
|
||||
command = [ "pinentry-start" ];
|
||||
hook = [ "(after-init . pinentry-start)" ];
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.mu4e = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
command = [ "mu4e" ];
|
||||
diminish = [ "mu4e-mode" ];
|
||||
hook = [
|
||||
"(mu4e-view-mode . visual-line-mode)"
|
||||
"(mu4e-compose-mode . flyspell-mode)"
|
||||
''(message-send . (lambda ()
|
||||
(unless (yes-or-no-p "Send this message?")
|
||||
(signal 'quit nil))))''
|
||||
];
|
||||
bind = { "\t" = "'company-complete-common"; };
|
||||
bindLocal = rec {
|
||||
mu4e-headers-mode-map = {
|
||||
"C-+" = "nil";
|
||||
"C--" = "nil";
|
||||
};
|
||||
mu4e-view-mode-map = mu4e-headers-mode-map;
|
||||
in
|
||||
mkIf (elem "emacs::mu4e" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.pinentry = {
|
||||
enable = true;
|
||||
command = ["pinentry-start"];
|
||||
hook = ["(after-init . pinentry-start)"];
|
||||
};
|
||||
init = ''
|
||||
;; (add-to-list 'load-path "${defaultEncrypt}/share/emacs/site-lisp")
|
||||
;; (require 'jl-encrypt)
|
||||
'';
|
||||
config = ''
|
||||
(setq mail-user-agent 'mu4e-user-agent)
|
||||
(setq org-mu4e-link-query-in-headers-mode t)
|
||||
(setq mu4e-maildir "~/.mail/Mail")
|
||||
(setq mu4e-get-mail-command "${pkgs.isync}/bin/mbsync -a")
|
||||
(setq mu4e-context-policy 'pick-first)
|
||||
(setq mu4e-change-filenames-when-moving t)
|
||||
(setq starttls-use-gnutls t)
|
||||
(setq message-send-mail-function 'smtpmail-send-it)
|
||||
(setq mu4e-update-interval 300)
|
||||
(setq mu4e-use-fancy-chars t)
|
||||
(setq mu4e-view-show-addresses t)
|
||||
(setq mu4e-headers-show-threads t)
|
||||
(setq mu4e-headers-skip-duplicates t)
|
||||
(setq mail-user-agent 'mu4e-user-agent)
|
||||
(defvaralias 'mu4e-compose-signature 'message-signature)
|
||||
(setq-default mu4e-save-multiple-attachments-without-asking t)
|
||||
(setq-default mu4e-view-show-addresses t)
|
||||
(setq-default mu4e-confirm-quit nil)
|
||||
(setq-default mu4e-hide-index-messages t)
|
||||
(setq-default mu4e-index-update-in-background t)
|
||||
(setq mu4e-compose-in-new-frame nil)
|
||||
|
||||
;;rename files when moving
|
||||
;;NEEDED FOR MBSYNC
|
||||
(setq mu4e-change-filenames-when-moving t)
|
||||
programs.emacs.init.usePackage.mu4e = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
command = ["mu4e"];
|
||||
diminish = ["mu4e-mode"];
|
||||
hook = [
|
||||
"(mu4e-view-mode . visual-line-mode)"
|
||||
"(mu4e-compose-mode . flyspell-mode)"
|
||||
'' (message-send . (lambda ()
|
||||
(unless (yes-or-no-p "Send this message?")
|
||||
(signal 'quit nil))))''
|
||||
];
|
||||
bind = {"\t" = "'company-complete-common";};
|
||||
bindLocal = rec {
|
||||
mu4e-headers-mode-map = {
|
||||
"C-+" = "nil";
|
||||
"C--" = "nil";
|
||||
};
|
||||
mu4e-view-mode-map = mu4e-headers-mode-map;
|
||||
};
|
||||
init = ''
|
||||
;; (add-to-list 'load-path "${defaultEncrypt}/share/emacs/site-lisp")
|
||||
;; (require 'jl-encrypt)
|
||||
'';
|
||||
config = ''
|
||||
(setq mail-user-agent 'mu4e-user-agent)
|
||||
(setq org-mu4e-link-query-in-headers-mode t)
|
||||
(setq mu4e-maildir "~/.mail/Mail")
|
||||
(setq mu4e-get-mail-command "${pkgs.isync}/bin/mbsync -a")
|
||||
(setq mu4e-context-policy 'pick-first)
|
||||
(setq mu4e-change-filenames-when-moving t)
|
||||
(setq starttls-use-gnutls t)
|
||||
(setq message-send-mail-function 'smtpmail-send-it)
|
||||
(setq mu4e-update-interval 300)
|
||||
(setq mu4e-use-fancy-chars t)
|
||||
(setq mu4e-view-show-addresses t)
|
||||
(setq mu4e-headers-show-threads t)
|
||||
(setq mu4e-headers-skip-duplicates t)
|
||||
(setq mail-user-agent 'mu4e-user-agent)
|
||||
(defvaralias 'mu4e-compose-signature 'message-signature)
|
||||
(setq-default mu4e-save-multiple-attachments-without-asking t)
|
||||
(setq-default mu4e-view-show-addresses t)
|
||||
(setq-default mu4e-confirm-quit nil)
|
||||
(setq-default mu4e-hide-index-messages t)
|
||||
(setq-default mu4e-index-update-in-background t)
|
||||
(setq mu4e-compose-in-new-frame nil)
|
||||
|
||||
(setq mu4e-html2text-command "iconv -c -t utf-8 | ${pkgs.pandoc}/bin/pandoc -f html -t plain")
|
||||
(setq mu4e-view-show-images t)
|
||||
(when (fboundp 'imagemagick-register-types)
|
||||
(imagemagick-register-types))
|
||||
(setq message-kill-buffer-on-exit t)
|
||||
;;rename files when moving
|
||||
;;NEEDED FOR MBSYNC
|
||||
(setq mu4e-change-filenames-when-moving t)
|
||||
|
||||
;; Encryption Stuff
|
||||
;; (setq mml-secure-openpgp-sign-with-sender t)
|
||||
;; ;; (setq mm-sign-option ‘guided’)
|
||||
;; (setq epa-pinentry-mode 'loopback)
|
||||
;; mailAcc config goes here
|
||||
(load-file "~/.emacs.d/mu4e.el")
|
||||
(setq mu4e-html2text-command "iconv -c -t utf-8 | ${pkgs.pandoc}/bin/pandoc -f html -t plain")
|
||||
(setq mu4e-view-show-images t)
|
||||
(when (fboundp 'imagemagick-register-types)
|
||||
(imagemagick-register-types))
|
||||
(setq message-kill-buffer-on-exit t)
|
||||
|
||||
(defun my-browse-url-firefox-privately (url &optional new-window)
|
||||
"Make firefox open URL in private-browsing window."
|
||||
(interactive (browse-url-interactive-arg "URL: "))
|
||||
(let ((process-environment (browse-url-process-environment)))
|
||||
(apply 'start-process
|
||||
(concat "firefox " url)
|
||||
nil
|
||||
browse-url-firefox-program
|
||||
(list "-private-window" url))))
|
||||
(setq browse-url-browser-function 'my-browse-url-firefox-privately)
|
||||
(add-to-list 'mu4e-view-actions
|
||||
'("ViewInBrowser" . mu4e-action-view-in-browser) t)
|
||||
'';
|
||||
extraConfig = ''
|
||||
:load-path "${pkgs.mu}/share/emacs/site-lisp/mu4e"
|
||||
'';
|
||||
};
|
||||
;; Encryption Stuff
|
||||
;; (setq mml-secure-openpgp-sign-with-sender t)
|
||||
;; ;; (setq mm-sign-option ‘guided’)
|
||||
;; (setq epa-pinentry-mode 'loopback)
|
||||
;; mailAcc config goes here
|
||||
(load-file "~/.emacs.d/mu4e.el")
|
||||
|
||||
programs.emacs.init.usePackage.mu4e-alert = {
|
||||
enable = true;
|
||||
# hook = [ "after-init . mu4e-alert-enable-mode-line-display" ];
|
||||
};
|
||||
(defun my-browse-url-firefox-privately (url &optional new-window)
|
||||
"Make firefox open URL in private-browsing window."
|
||||
(interactive (browse-url-interactive-arg "URL: "))
|
||||
(let ((process-environment (browse-url-process-environment)))
|
||||
(apply 'start-process
|
||||
(concat "firefox " url)
|
||||
nil
|
||||
browse-url-firefox-program
|
||||
(list "-private-window" url))))
|
||||
(setq browse-url-browser-function 'my-browse-url-firefox-privately)
|
||||
(add-to-list 'mu4e-view-actions
|
||||
'("ViewInBrowser" . mu4e-action-view-in-browser) t)
|
||||
'';
|
||||
extraConfig = ''
|
||||
:load-path "${pkgs.mu}/share/emacs/site-lisp/mu4e"
|
||||
'';
|
||||
};
|
||||
|
||||
# programs.emacs.init.usePackage.org-mu4e = {
|
||||
# enable = (elem "emacs::org" config.machine.pkgs);
|
||||
# };
|
||||
programs.emacs.init.usePackage.mu4e-alert = {
|
||||
enable = true;
|
||||
# hook = [ "after-init . mu4e-alert-enable-mode-line-display" ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
mu
|
||||
isync
|
||||
];
|
||||
}
|
||||
# programs.emacs.init.usePackage.org-mu4e = {
|
||||
# enable = (elem "emacs::org" config.machine.pkgs);
|
||||
# };
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
mu
|
||||
isync
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::nix-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.nix-mode = {
|
||||
enable = true;
|
||||
mode = [ ''"\\.nix\\'"'' ];
|
||||
config = ''(setq nix-nixfmt-bin "nixfmt -w 150")'';
|
||||
};
|
||||
}
|
||||
mkIf (elem "emacs::nix-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.nix-mode = {
|
||||
enable = true;
|
||||
mode = [''"\\.nix\\'"''];
|
||||
config = ''(setq nix-nixfmt-bin "nixfmt -w 150")'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,426 +1,440 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::org" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.org = {
|
||||
enable = true;
|
||||
package = epkgs: [epkgs.org];
|
||||
mode = [''("\\.org\\'" . org-mode)''];
|
||||
command = ["org-mode"];
|
||||
hook =
|
||||
[
|
||||
"(org-mode . (lambda () (org-indent-mode)))"
|
||||
''
|
||||
(org-mode
|
||||
. (lambda ()
|
||||
;; Automatic line-wrapping in org-mode
|
||||
;;(auto-fill-mode 1)
|
||||
|
||||
mkIf (elem "emacs::org" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.org = {
|
||||
enable = true;
|
||||
package = epkgs: [ epkgs.org ];
|
||||
mode = [ ''("\\.org\\'" . org-mode)'' ];
|
||||
command = [ "org-mode" ];
|
||||
hook = [ "(org-mode . (lambda () (org-indent-mode)))" ''
|
||||
(org-mode
|
||||
. (lambda ()
|
||||
;; Automatic line-wrapping in org-mode
|
||||
;;(auto-fill-mode 1)
|
||||
(setq completion-at-point-functions
|
||||
'(org-completion-symbols
|
||||
ora-cap-filesystem))))
|
||||
''
|
||||
''
|
||||
(org-mode
|
||||
. (lambda ()
|
||||
"Beautify Org Checkbox Symbol"
|
||||
(push '("[ ]" . "☐" ) prettify-symbols-alist)
|
||||
(push '("[X]" . "☑" ) prettify-symbols-alist)
|
||||
(push '("[-]" . "❍" ) prettify-symbols-alist)
|
||||
(prettify-symbols-mode)))
|
||||
''
|
||||
]
|
||||
++ optional (elem "emacs::flyspell" config.machine.pkgs) "(org-mode . (lambda () (flyspell-mode)))";
|
||||
bind = {
|
||||
"C-c a" = "org-agenda";
|
||||
};
|
||||
bindLocal = {
|
||||
org-mode-map =
|
||||
{
|
||||
"M-<up>" = "org-metaup";
|
||||
"M-<down>" = "org-metadown";
|
||||
"M-." = "org-open-at-point";
|
||||
"M-," = "org-mark-ring-goto";
|
||||
"M-S-<return>" = "org-insert-todo-heading-respect-content";
|
||||
"M-<return>" = "org-meta-return";
|
||||
"M-p" = "org-previous-visible-heading";
|
||||
"M-n" = "org-next-visible-heading";
|
||||
}
|
||||
// (optionalAttrs (elem "emacs::company" config.machine.pkgs) {
|
||||
"<M-tab>" = "company-pcomplete";
|
||||
});
|
||||
};
|
||||
config = ''
|
||||
;; Insead of "..." show "…" when there's hidden folded content
|
||||
|
||||
(setq completion-at-point-functions
|
||||
'(org-completion-symbols
|
||||
ora-cap-filesystem))))
|
||||
'' ''
|
||||
(org-mode
|
||||
. (lambda ()
|
||||
"Beautify Org Checkbox Symbol"
|
||||
(push '("[ ]" . "☐" ) prettify-symbols-alist)
|
||||
(push '("[X]" . "☑" ) prettify-symbols-alist)
|
||||
(push '("[-]" . "❍" ) prettify-symbols-alist)
|
||||
(prettify-symbols-mode)))
|
||||
''
|
||||
] ++ optional (elem "emacs::flyspell" config.machine.pkgs) "(org-mode . (lambda () (flyspell-mode)))";
|
||||
bind = {
|
||||
"C-c a" = "org-agenda";
|
||||
;; org-prettify
|
||||
(defface org-checkbox-done-text
|
||||
'((t (:foreground "#71696A" :strike-through t)))
|
||||
"Face for the text part of a checked org-mode checkbox.")
|
||||
|
||||
(font-lock-add-keywords
|
||||
'org-mode
|
||||
`(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)"
|
||||
1 'org-checkbox-done-text prepend))
|
||||
'append)
|
||||
|
||||
;; Some characters to choose from: …, ⤵, ▼, ↴, ⬎, ⤷, and ⋱
|
||||
(setq org-ellipsis " ▼")
|
||||
;; get nice looking tables (only for non org-tables; rarely used)
|
||||
(setq table-cell-horizontal-chars "\u2501")
|
||||
(setq table-cell-vertical-char ?\u2503)
|
||||
(setq table-cell-intersection-char ?\u254B)
|
||||
|
||||
(setq org-directory "~/Documents/org/")
|
||||
|
||||
;; Show headings up to level 2 by default when opening an org files
|
||||
(setq org-startup-folded 'content)
|
||||
|
||||
;; Show inline images by default
|
||||
(setq org-startup-with-inline-images t)
|
||||
|
||||
;; Add more levels to headlines that get displayed with imenu
|
||||
(setq org-imenu-depth 5)
|
||||
|
||||
;; Enter key follows links (= C-c C-o)
|
||||
(setq org-return-follows-link t)
|
||||
|
||||
;; Don't remove links after inserting
|
||||
(setq org-keep-stored-link-after-insertion t)
|
||||
|
||||
(setq org-tag-alist (quote ((:startgroup)
|
||||
("WAITING" . ?w)
|
||||
("HOLD" . ?h)
|
||||
("CANCELLED" . ?c)
|
||||
("NOTE" . ?n)
|
||||
(:endgroup)
|
||||
("PERSONAL" . ?P)
|
||||
("WORK" . ?W)
|
||||
("ATOMX" . ?A)
|
||||
("E5" . ?E)
|
||||
("HOGASO" . ?H)
|
||||
("ORG" . ?o)
|
||||
("crypt" . ?C)
|
||||
("FLAGGED" . ??))))
|
||||
|
||||
;; Allow setting single tags without the menu
|
||||
(setq org-fast-tag-selection-single-key (quote expert))
|
||||
|
||||
(setq org-archive-mark-done nil)
|
||||
(setq org-archive-location "%s_archive::* Archived Tasks")
|
||||
|
||||
;; C-RET, C-S-RET insert new heading after current task content
|
||||
(setq org-insert-heading-respect-content nil)
|
||||
|
||||
;; Show a little bit more when using sparse-trees
|
||||
(setq org-show-following-heading t)
|
||||
(setq org-show-hierarchy-above t)
|
||||
(setq org-show-siblings (quote ((default))))
|
||||
|
||||
;; don't show * / = etc
|
||||
(setq org-hide-emphasis-markers t)
|
||||
|
||||
;; leave highlights in sparse tree after edit. C-c C-c removes highlights
|
||||
(setq org-remove-highlights-with-change nil)
|
||||
|
||||
;; M-RET should not split the lines
|
||||
(setq org-M-RET-may-split-line '((default . nil)))
|
||||
|
||||
(setq org-special-ctrl-a/e t)
|
||||
(setq org-special-ctrl-k t)
|
||||
(setq org-yank-adjusted-subtrees t)
|
||||
|
||||
;; Show org entities as UTF-8 characters (e.g. \sum as ∑)
|
||||
(setq org-pretty-entities t)
|
||||
;; But Don't print "bar" as subscript in "foo_bar"
|
||||
(setq org-pretty-entities-include-sub-superscripts nil)
|
||||
;; And also don't display ^ or _ as super/subscripts
|
||||
(setq org-use-sub-superscripts nil)
|
||||
;; undone TODO entries will block switching the parent to DONE
|
||||
(setq org-enforce-todo-dependencies t)
|
||||
|
||||
(setq org-use-fast-todo-selection t)
|
||||
|
||||
(setq org-todo-keywords
|
||||
(quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
|
||||
(sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "PHONE" "MEETING"))))
|
||||
|
||||
(setq org-todo-keyword-faces
|
||||
(quote (("TODO" :foreground "red" :weight bold)
|
||||
("NEXT" :foreground "blue" :weight bold)
|
||||
("DONE" :foreground "forest green" :weight bold)
|
||||
("WAITING" :foreground "orange" :weight bold)
|
||||
("HOLD" :foreground "magenta" :weight bold)
|
||||
("CANCELLED" :foreground "forest green" :weight bold)
|
||||
("MEETING" :foreground "forest green" :weight bold)
|
||||
("PHONE" :foreground "forest green" :weight bold))))
|
||||
|
||||
;; Auto completion for symbols in org-mode
|
||||
;; https://oremacs.com/2017/10/04/completion-at-point/
|
||||
(defun org-completion-symbols ()
|
||||
(when (looking-back "[`~=][a-zA-Z]+" nil)
|
||||
(let (cands)
|
||||
(save-match-data
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "[`~=]\\([a-zA-Z.\\-_]+\\)[`~=]" nil t)
|
||||
(cl-pushnew
|
||||
(match-string-no-properties 0) cands :test 'equal))
|
||||
cands))
|
||||
(when cands
|
||||
(list (match-beginning 0) (match-end 0) cands)))))
|
||||
|
||||
(defun ora-cap-filesystem ()
|
||||
(let (path)
|
||||
(when (setq path (ffap-string-at-point))
|
||||
(when (string-match "\\`file:\\(.*\\)\\'" path)
|
||||
(setq path (match-string 1 path)))
|
||||
(let ((compl (all-completions path #'read-file-name-internal)))
|
||||
(when compl
|
||||
(let* ((str (car compl))
|
||||
(offset
|
||||
(let ((i 0)
|
||||
(len (length str)))
|
||||
(while (and (< i len)
|
||||
(equal (get-text-property i 'face str)
|
||||
'completions-common-part))
|
||||
(cl-incf i))
|
||||
i)))
|
||||
(list (- (point) offset) (point) compl)))))))
|
||||
|
||||
'';
|
||||
};
|
||||
bindLocal = { org-mode-map = {
|
||||
"M-<up>" = "org-metaup";
|
||||
"M-<down>" = "org-metadown";
|
||||
"M-." = "org-open-at-point";
|
||||
"M-," = "org-mark-ring-goto";
|
||||
"M-S-<return>" = "org-insert-todo-heading-respect-content";
|
||||
"M-<return>" = "org-meta-return";
|
||||
"M-p" = "org-previous-visible-heading";
|
||||
"M-n" = "org-next-visible-heading";
|
||||
} // (optionalAttrs (elem "emacs::company" config.machine.pkgs) {
|
||||
"<M-tab>" = "company-pcomplete";
|
||||
}); };
|
||||
config = ''
|
||||
;; Insead of "..." show "…" when there's hidden folded content
|
||||
|
||||
;; org-prettify
|
||||
(defface org-checkbox-done-text
|
||||
'((t (:foreground "#71696A" :strike-through t)))
|
||||
"Face for the text part of a checked org-mode checkbox.")
|
||||
programs.emacs.init.usePackage.ob = {
|
||||
enable = true;
|
||||
package = epkgs: [epkgs.ob-ipython epkgs.ob-rust epkgs.ob-diagrams];
|
||||
defer = true;
|
||||
init = ''
|
||||
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)
|
||||
'';
|
||||
config = ''
|
||||
(setq org-confirm-babel-evaluate nil) ; don't prompt me to confirm everytime I want to evaluate a block
|
||||
|
||||
(font-lock-add-keywords
|
||||
'org-mode
|
||||
`(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)"
|
||||
1 'org-checkbox-done-text prepend))
|
||||
'append)
|
||||
(defun org-babel-restart-session-to-point (&optional arg)
|
||||
"Restart session up to the src-block in the current point.
|
||||
Goes to beginning of buffer and executes each code block with
|
||||
`org-babel-execute-src-block' that has the same language and
|
||||
session as the current block. ARG has same meaning as in
|
||||
`org-babel-execute-src-block'."
|
||||
(interactive "P")
|
||||
(unless (org-in-src-block-p)
|
||||
(error "You must be in a src-block to run this command"))
|
||||
(let* ((current-point (point-marker))
|
||||
(info (org-babel-get-src-block-info))
|
||||
(lang (nth 0 info))
|
||||
(params (nth 2 info))
|
||||
(session (cdr (assoc :session params))))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-babel-src-block-regexp nil t)
|
||||
;; goto start of block
|
||||
(goto-char (match-beginning 0))
|
||||
(let* ((this-info (org-babel-get-src-block-info))
|
||||
(this-lang (nth 0 this-info))
|
||||
(this-params (nth 2 this-info))
|
||||
(this-session (cdr (assoc :session this-params))))
|
||||
(when
|
||||
(and
|
||||
(< (point) (marker-position current-point))
|
||||
(string= lang this-lang)
|
||||
(src-block-in-session-p session))
|
||||
(org-babel-execute-src-block arg)))
|
||||
;; move forward so we can find the next block
|
||||
(forward-line)))))
|
||||
|
||||
;; Some characters to choose from: …, ⤵, ▼, ↴, ⬎, ⤷, and ⋱
|
||||
(setq org-ellipsis " ▼")
|
||||
;; get nice looking tables (only for non org-tables; rarely used)
|
||||
(setq table-cell-horizontal-chars "\u2501")
|
||||
(setq table-cell-vertical-char ?\u2503)
|
||||
(setq table-cell-intersection-char ?\u254B)
|
||||
(defun org-babel-kill-session ()
|
||||
"Kill session for current code block."
|
||||
(interactive)
|
||||
(unless (org-in-src-block-p)
|
||||
(error "You must be in a src-block to run this command"))
|
||||
(save-window-excursion
|
||||
(org-babel-switch-to-session)
|
||||
(kill-buffer)))
|
||||
|
||||
(setq org-directory "~/Documents/org/")
|
||||
|
||||
;; Show headings up to level 2 by default when opening an org files
|
||||
(setq org-startup-folded 'content)
|
||||
|
||||
;; Show inline images by default
|
||||
(setq org-startup-with-inline-images t)
|
||||
|
||||
;; Add more levels to headlines that get displayed with imenu
|
||||
(setq org-imenu-depth 5)
|
||||
|
||||
;; Enter key follows links (= C-c C-o)
|
||||
(setq org-return-follows-link t)
|
||||
|
||||
;; Don't remove links after inserting
|
||||
(setq org-keep-stored-link-after-insertion t)
|
||||
|
||||
(setq org-tag-alist (quote ((:startgroup)
|
||||
("WAITING" . ?w)
|
||||
("HOLD" . ?h)
|
||||
("CANCELLED" . ?c)
|
||||
("NOTE" . ?n)
|
||||
(:endgroup)
|
||||
("PERSONAL" . ?P)
|
||||
("WORK" . ?W)
|
||||
("ATOMX" . ?A)
|
||||
("E5" . ?E)
|
||||
("HOGASO" . ?H)
|
||||
("ORG" . ?o)
|
||||
("crypt" . ?C)
|
||||
("FLAGGED" . ??))))
|
||||
|
||||
;; Allow setting single tags without the menu
|
||||
(setq org-fast-tag-selection-single-key (quote expert))
|
||||
|
||||
(setq org-archive-mark-done nil)
|
||||
(setq org-archive-location "%s_archive::* Archived Tasks")
|
||||
|
||||
;; C-RET, C-S-RET insert new heading after current task content
|
||||
(setq org-insert-heading-respect-content nil)
|
||||
|
||||
;; Show a little bit more when using sparse-trees
|
||||
(setq org-show-following-heading t)
|
||||
(setq org-show-hierarchy-above t)
|
||||
(setq org-show-siblings (quote ((default))))
|
||||
|
||||
;; don't show * / = etc
|
||||
(setq org-hide-emphasis-markers t)
|
||||
|
||||
;; leave highlights in sparse tree after edit. C-c C-c removes highlights
|
||||
(setq org-remove-highlights-with-change nil)
|
||||
|
||||
;; M-RET should not split the lines
|
||||
(setq org-M-RET-may-split-line '((default . nil)))
|
||||
|
||||
(setq org-special-ctrl-a/e t)
|
||||
(setq org-special-ctrl-k t)
|
||||
(setq org-yank-adjusted-subtrees t)
|
||||
|
||||
;; Show org entities as UTF-8 characters (e.g. \sum as ∑)
|
||||
(setq org-pretty-entities t)
|
||||
;; But Don't print "bar" as subscript in "foo_bar"
|
||||
(setq org-pretty-entities-include-sub-superscripts nil)
|
||||
;; And also don't display ^ or _ as super/subscripts
|
||||
(setq org-use-sub-superscripts nil)
|
||||
;; undone TODO entries will block switching the parent to DONE
|
||||
(setq org-enforce-todo-dependencies t)
|
||||
|
||||
(setq org-use-fast-todo-selection t)
|
||||
|
||||
(setq org-todo-keywords
|
||||
(quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
|
||||
(sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "PHONE" "MEETING"))))
|
||||
|
||||
(setq org-todo-keyword-faces
|
||||
(quote (("TODO" :foreground "red" :weight bold)
|
||||
("NEXT" :foreground "blue" :weight bold)
|
||||
("DONE" :foreground "forest green" :weight bold)
|
||||
("WAITING" :foreground "orange" :weight bold)
|
||||
("HOLD" :foreground "magenta" :weight bold)
|
||||
("CANCELLED" :foreground "forest green" :weight bold)
|
||||
("MEETING" :foreground "forest green" :weight bold)
|
||||
("PHONE" :foreground "forest green" :weight bold))))
|
||||
|
||||
;; Auto completion for symbols in org-mode
|
||||
;; https://oremacs.com/2017/10/04/completion-at-point/
|
||||
(defun org-completion-symbols ()
|
||||
(when (looking-back "[`~=][a-zA-Z]+" nil)
|
||||
(let (cands)
|
||||
(save-match-data
|
||||
(defun org-babel-remove-result-buffer ()
|
||||
"Remove results from every code block in buffer."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "[`~=]\\([a-zA-Z.\\-_]+\\)[`~=]" nil t)
|
||||
(cl-pushnew
|
||||
(match-string-no-properties 0) cands :test 'equal))
|
||||
cands))
|
||||
(when cands
|
||||
(list (match-beginning 0) (match-end 0) cands)))))
|
||||
|
||||
(defun ora-cap-filesystem ()
|
||||
(let (path)
|
||||
(when (setq path (ffap-string-at-point))
|
||||
(when (string-match "\\`file:\\(.*\\)\\'" path)
|
||||
(setq path (match-string 1 path)))
|
||||
(let ((compl (all-completions path #'read-file-name-internal)))
|
||||
(when compl
|
||||
(let* ((str (car compl))
|
||||
(offset
|
||||
(let ((i 0)
|
||||
(len (length str)))
|
||||
(while (and (< i len)
|
||||
(equal (get-text-property i 'face str)
|
||||
'completions-common-part))
|
||||
(cl-incf i))
|
||||
i)))
|
||||
(list (- (point) offset) (point) compl)))))))
|
||||
|
||||
'';
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.ob = {
|
||||
enable = true;
|
||||
package = epkgs: [ epkgs.ob-ipython epkgs.ob-rust epkgs.ob-diagrams ];
|
||||
defer = true;
|
||||
init = ''
|
||||
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)
|
||||
'';
|
||||
config = ''
|
||||
(setq org-confirm-babel-evaluate nil) ; don't prompt me to confirm everytime I want to evaluate a block
|
||||
|
||||
(defun org-babel-restart-session-to-point (&optional arg)
|
||||
"Restart session up to the src-block in the current point.
|
||||
Goes to beginning of buffer and executes each code block with
|
||||
`org-babel-execute-src-block' that has the same language and
|
||||
session as the current block. ARG has same meaning as in
|
||||
`org-babel-execute-src-block'."
|
||||
(interactive "P")
|
||||
(unless (org-in-src-block-p)
|
||||
(error "You must be in a src-block to run this command"))
|
||||
(let* ((current-point (point-marker))
|
||||
(info (org-babel-get-src-block-info))
|
||||
(lang (nth 0 info))
|
||||
(params (nth 2 info))
|
||||
(session (cdr (assoc :session params))))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-babel-src-block-regexp nil t)
|
||||
;; goto start of block
|
||||
(goto-char (match-beginning 0))
|
||||
(let* ((this-info (org-babel-get-src-block-info))
|
||||
(this-lang (nth 0 this-info))
|
||||
(this-params (nth 2 this-info))
|
||||
(this-session (cdr (assoc :session this-params))))
|
||||
(when
|
||||
(and
|
||||
(< (point) (marker-position current-point))
|
||||
(string= lang this-lang)
|
||||
(src-block-in-session-p session))
|
||||
(org-babel-execute-src-block arg)))
|
||||
;; move forward so we can find the next block
|
||||
(forward-line)))))
|
||||
|
||||
(defun org-babel-kill-session ()
|
||||
"Kill session for current code block."
|
||||
(interactive)
|
||||
(unless (org-in-src-block-p)
|
||||
(error "You must be in a src-block to run this command"))
|
||||
(save-window-excursion
|
||||
(org-babel-switch-to-session)
|
||||
(kill-buffer)))
|
||||
|
||||
(defun org-babel-remove-result-buffer ()
|
||||
"Remove results from every code block in buffer."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-babel-src-block-regexp nil t)
|
||||
(org-babel-remove-result))))
|
||||
(while (re-search-forward org-babel-src-block-regexp nil t)
|
||||
(org-babel-remove-result))))
|
||||
|
||||
|
||||
;; this adds a "new language" in babel that gets exported as js in html
|
||||
;; https://www.reddit.com/r/orgmode/comments/5bi6ku/tip_for_exporting_javascript_source_block_to/
|
||||
(add-to-list 'org-src-lang-modes '("inline-js" . javascript))
|
||||
(defvar org-babel-default-header-args:inline-js
|
||||
'((:results . "html")
|
||||
(:exports . "results")))
|
||||
(defun org-babel-execute:inline-js (body _params)
|
||||
(format "<script type=\"text/javascript\">\n%s\n</script>" body))
|
||||
;; this adds a "new language" in babel that gets exported as js in html
|
||||
;; https://www.reddit.com/r/orgmode/comments/5bi6ku/tip_for_exporting_javascript_source_block_to/
|
||||
(add-to-list 'org-src-lang-modes '("inline-js" . javascript))
|
||||
(defvar org-babel-default-header-args:inline-js
|
||||
'((:results . "html")
|
||||
(:exports . "results")))
|
||||
(defun org-babel-execute:inline-js (body _params)
|
||||
(format "<script type=\"text/javascript\">\n%s\n</script>" body))
|
||||
|
||||
;; Path when plantuml is installed from AUR (package `plantuml')
|
||||
(setq org-plantuml-jar-path "/opt/plantuml/plantuml.jar")
|
||||
;; Path when plantuml is installed from AUR (package `plantuml')
|
||||
(setq org-plantuml-jar-path "/opt/plantuml/plantuml.jar")
|
||||
|
||||
;; add all languages to org mode
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((C . t)
|
||||
;;(R . t)
|
||||
(asymptote)
|
||||
(awk)
|
||||
(calc . t)
|
||||
(clojure . t)
|
||||
(comint)
|
||||
(css)
|
||||
(ditaa . t)
|
||||
(dot . t)
|
||||
(emacs-lisp . t)
|
||||
(fortran)
|
||||
(gnuplot . t)
|
||||
(haskell)
|
||||
(io)
|
||||
(java)
|
||||
(js . t)
|
||||
(latex)
|
||||
(lilypond)
|
||||
(lisp)
|
||||
(lua . t)
|
||||
(matlab)
|
||||
(maxima)
|
||||
(mscgen)
|
||||
(ocaml)
|
||||
(octave . t)
|
||||
(org . t)
|
||||
(perl)
|
||||
(picolisp)
|
||||
(plantuml . t)
|
||||
(python . t)
|
||||
;; (ipython . t)
|
||||
;; (restclient . t)
|
||||
(ref)
|
||||
(ruby)
|
||||
(sass)
|
||||
(scala)
|
||||
(scheme)
|
||||
(screen)
|
||||
(shell . t)
|
||||
(shen)
|
||||
(snippet)
|
||||
(sql . t)
|
||||
(sqlite . t)))
|
||||
'';
|
||||
};
|
||||
;; add all languages to org mode
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((C . t)
|
||||
;;(R . t)
|
||||
(asymptote)
|
||||
(awk)
|
||||
(calc . t)
|
||||
(clojure . t)
|
||||
(comint)
|
||||
(css)
|
||||
(ditaa . t)
|
||||
(dot . t)
|
||||
(emacs-lisp . t)
|
||||
(fortran)
|
||||
(gnuplot . t)
|
||||
(haskell)
|
||||
(io)
|
||||
(java)
|
||||
(js . t)
|
||||
(latex)
|
||||
(lilypond)
|
||||
(lisp)
|
||||
(lua . t)
|
||||
(matlab)
|
||||
(maxima)
|
||||
(mscgen)
|
||||
(ocaml)
|
||||
(octave . t)
|
||||
(org . t)
|
||||
(perl)
|
||||
(picolisp)
|
||||
(plantuml . t)
|
||||
(python . t)
|
||||
;; (ipython . t)
|
||||
;; (restclient . t)
|
||||
(ref)
|
||||
(ruby)
|
||||
(sass)
|
||||
(scala)
|
||||
(scheme)
|
||||
(screen)
|
||||
(shell . t)
|
||||
(shen)
|
||||
(snippet)
|
||||
(sql . t)
|
||||
(sqlite . t)))
|
||||
'';
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.org-src = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
defer = true;
|
||||
init = ''(put 'org-src-preserve-indentation 'safe-local-variable 'booleanp)'';
|
||||
config = ''
|
||||
(setq org-src-window-setup 'current-window)
|
||||
programs.emacs.init.usePackage.org-src = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
defer = true;
|
||||
init = ''(put 'org-src-preserve-indentation 'safe-local-variable 'booleanp)'';
|
||||
config = ''
|
||||
(setq org-src-window-setup 'current-window)
|
||||
|
||||
(setq org-src-fontify-natively t) ; syntax highlighting for source code blocks
|
||||
(setq org-src-fontify-natively t) ; syntax highlighting for source code blocks
|
||||
|
||||
;; Tab should do indent in code blocks
|
||||
;; I think I hate this function (causes scroll on TAB
|
||||
(setq org-src-tab-acts-natively t)
|
||||
;; ?Fix weird scrolling
|
||||
;; Tab should do indent in code blocks
|
||||
;; I think I hate this function (causes scroll on TAB
|
||||
(setq org-src-tab-acts-natively t)
|
||||
;; ?Fix weird scrolling
|
||||
|
||||
;; Don't remove (or add) any extra whitespace
|
||||
(setq org-src-preserve-indentation nil)
|
||||
(setq org-edit-src-content-indentation 0)
|
||||
;; Don't remove (or add) any extra whitespace
|
||||
(setq org-src-preserve-indentation nil)
|
||||
(setq org-edit-src-content-indentation 0)
|
||||
|
||||
;;; Some helper function to manage org-babel sessions
|
||||
;;; Some helper function to manage org-babel sessions
|
||||
|
||||
(defun src-block-in-session-p (&optional name)
|
||||
"Return if src-block is in a session of NAME.
|
||||
NAME may be nil for unnamed sessions."
|
||||
(let* ((info (org-babel-get-src-block-info))
|
||||
;;(lang (nth 0 info))
|
||||
;;(body (nth 1 info))
|
||||
(params (nth 2 info))
|
||||
(session (cdr (assoc :session params))))
|
||||
(defun src-block-in-session-p (&optional name)
|
||||
"Return if src-block is in a session of NAME.
|
||||
NAME may be nil for unnamed sessions."
|
||||
(let* ((info (org-babel-get-src-block-info))
|
||||
;;(lang (nth 0 info))
|
||||
;;(body (nth 1 info))
|
||||
(params (nth 2 info))
|
||||
(session (cdr (assoc :session params))))
|
||||
|
||||
(cond
|
||||
;; unnamed session, both name and session are nil
|
||||
((and (null session)
|
||||
(null name))
|
||||
t)
|
||||
;; Matching name and session
|
||||
((and
|
||||
(stringp name)
|
||||
(stringp session)
|
||||
(string= name session))
|
||||
t)
|
||||
;; no match
|
||||
(t nil))))
|
||||
(cond
|
||||
;; unnamed session, both name and session are nil
|
||||
((and (null session)
|
||||
(null name))
|
||||
t)
|
||||
;; Matching name and session
|
||||
((and
|
||||
(stringp name)
|
||||
(stringp session)
|
||||
(string= name session))
|
||||
t)
|
||||
;; no match
|
||||
(t nil))))
|
||||
|
||||
;; dot == graphviz-dot
|
||||
(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
|
||||
;; dot == graphviz-dot
|
||||
(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
|
||||
|
||||
;; Add 'conf-mode' to org-babel
|
||||
(add-to-list 'org-src-lang-modes '("ini" . conf))
|
||||
(add-to-list 'org-src-lang-modes '("conf" . conf))
|
||||
'';
|
||||
};
|
||||
;; Add 'conf-mode' to org-babel
|
||||
(add-to-list 'org-src-lang-modes '("ini" . conf))
|
||||
(add-to-list 'org-src-lang-modes '("conf" . conf))
|
||||
'';
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.org-tempo = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
};
|
||||
programs.emacs.init.usePackage.org-tempo = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.ox = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
defer = true;
|
||||
command = [];
|
||||
config = ''
|
||||
;; Use html5 as org export and use new tags
|
||||
(setq org-html-doctype "html5")
|
||||
(setq org-html-html5-fancy t)
|
||||
;; Don't add html footer to export
|
||||
(setq org-html-postamble nil)
|
||||
;; Don't export ^ or _ as super/subscripts
|
||||
(setq org-export-with-sub-superscripts nil)
|
||||
'';
|
||||
};
|
||||
programs.emacs.init.usePackage.ox = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
defer = true;
|
||||
command = [];
|
||||
config = ''
|
||||
;; Use html5 as org export and use new tags
|
||||
(setq org-html-doctype "html5")
|
||||
(setq org-html-html5-fancy t)
|
||||
;; Don't add html footer to export
|
||||
(setq org-html-postamble nil)
|
||||
;; Don't export ^ or _ as super/subscripts
|
||||
(setq org-export-with-sub-superscripts nil)
|
||||
'';
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.ox-gfm = {
|
||||
enable = true;
|
||||
after = [ "ox" ];
|
||||
};
|
||||
programs.emacs.init.usePackage.ox-gfm = {
|
||||
enable = true;
|
||||
after = ["ox"];
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.ox-rst = {
|
||||
enable = true;
|
||||
after = [ "ox" ];
|
||||
};
|
||||
programs.emacs.init.usePackage.ox-rst = {
|
||||
enable = true;
|
||||
after = ["ox"];
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.ox-md = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
after = [ "ox" ];
|
||||
};
|
||||
programs.emacs.init.usePackage.ox-md = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
after = ["ox"];
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.org-bullets = {
|
||||
enable = true;
|
||||
hook = [ "(org-mode . org-bullets-mode)" ];
|
||||
};
|
||||
programs.emacs.init.usePackage.org-bullets = {
|
||||
enable = true;
|
||||
hook = ["(org-mode . org-bullets-mode)"];
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.org-crypt = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
after = [ "org" ];
|
||||
hook = [ "(org-mode . (lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t)))" ];
|
||||
command = [ "org-decrypt-entry" "org-encrypt-entry" ];
|
||||
bindLocal = { org-mode-map = {
|
||||
"C-c d" = "org-decrypt-entry";
|
||||
"C-c e" = "org-encrypt-entry";
|
||||
};};
|
||||
config = ''
|
||||
(setq org-tags-exclude-from-inheritance (quote ("crypt")))
|
||||
;; GPG key to use for encryption
|
||||
(load-file "~/.emacs.d/org-crypt-key.el")
|
||||
programs.emacs.init.usePackage.org-crypt = {
|
||||
enable = true;
|
||||
package = epkgs: null;
|
||||
after = ["org"];
|
||||
hook = ["(org-mode . (lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t)))"];
|
||||
command = ["org-decrypt-entry" "org-encrypt-entry"];
|
||||
bindLocal = {
|
||||
org-mode-map = {
|
||||
"C-c d" = "org-decrypt-entry";
|
||||
"C-c e" = "org-encrypt-entry";
|
||||
};
|
||||
};
|
||||
config = ''
|
||||
(setq org-tags-exclude-from-inheritance (quote ("crypt")))
|
||||
;; GPG key to use for encryption
|
||||
(load-file "~/.emacs.d/org-crypt-key.el")
|
||||
|
||||
;; don't ask to disable auto-save
|
||||
(setq org-crypt-disable-auto-save "encrypt")
|
||||
'';
|
||||
};
|
||||
;; don't ask to disable auto-save
|
||||
(setq org-crypt-disable-auto-save "encrypt")
|
||||
'';
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.org-drill = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
programs.emacs.init.usePackage.org-drill = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::php-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
php-mode = {
|
||||
enable = true;
|
||||
hook = lib.optional (elem "emacs::lsp" config.machine.pkgs)
|
||||
''(typescript-mode . (lambda () (lsp)))'';
|
||||
mkIf (elem "emacs::php-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
php-mode = {
|
||||
enable = true;
|
||||
hook =
|
||||
lib.optional (elem "emacs::lsp" config.machine.pkgs)
|
||||
''(typescript-mode . (lambda () (lsp)))'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::powerline" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.powerline = {
|
||||
enable = true;
|
||||
config = ''
|
||||
;; color palette from https://github.com/kuanyui/moe-theme.el/blob/master/moe-theme.el#L283
|
||||
(set-face-attribute 'mode-line nil :background "#afd7ff" :foreground "#005f87")
|
||||
(set-face-attribute 'mode-line-buffer-id nil :background "#afd7ff" :foreground "#080808")
|
||||
(set-face-attribute 'minibuffer-prompt nil :foreground "#5fafd7" :background "#3a3a3a")
|
||||
(powerline-default-theme)
|
||||
'';
|
||||
};
|
||||
}
|
||||
mkIf (elem "emacs::powerline" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.powerline = {
|
||||
enable = true;
|
||||
config = ''
|
||||
;; color palette from https://github.com/kuanyui/moe-theme.el/blob/master/moe-theme.el#L283
|
||||
(set-face-attribute 'mode-line nil :background "#afd7ff" :foreground "#005f87")
|
||||
(set-face-attribute 'mode-line-buffer-id nil :background "#afd7ff" :foreground "#080808")
|
||||
(set-face-attribute 'minibuffer-prompt nil :foreground "#5fafd7" :background "#3a3a3a")
|
||||
(powerline-default-theme)
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,45 +1,55 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
rustEnv = pkgs.symlinkJoin {
|
||||
name = "rustEnv";
|
||||
paths = config.machine.pkgsets.rustpkgs.pkgwrap;
|
||||
};
|
||||
in mkIf (elem "emacs::rust" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.rust-mode = {
|
||||
enable = true;
|
||||
hook = [ ''(rust-mode . (lambda () (cargo-minor-mode)))'' ]
|
||||
++ (if (elem "emacs::lsp" config.machine.pkgs)
|
||||
then [''(rust-mode . (lambda () (lsp)))'']
|
||||
else [''(rust-mode . (lambda () (racer-mode)))'']);
|
||||
mode = [ ''("\\.rs\\'" . rust-mode)'' ];
|
||||
command = [ "rust-mode" ];
|
||||
bindLocal = optionalAttrs (elem "emacs::company" config.machine.pkgs) { rust-mode-map = {
|
||||
"<tab>" = "company-indent-or-complete-common";
|
||||
};};
|
||||
config = ''
|
||||
(setq rust-rustfmt-bin "${rustEnv}/bin/rustfmt")
|
||||
(setq rust-format-on-save t)
|
||||
'';
|
||||
};
|
||||
in
|
||||
mkIf (elem "emacs::rust" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.rust-mode = {
|
||||
enable = true;
|
||||
hook =
|
||||
[''(rust-mode . (lambda () (cargo-minor-mode)))'']
|
||||
++ (
|
||||
if (elem "emacs::lsp" config.machine.pkgs)
|
||||
then [''(rust-mode . (lambda () (lsp)))'']
|
||||
else [''(rust-mode . (lambda () (racer-mode)))'']
|
||||
);
|
||||
mode = [''("\\.rs\\'" . rust-mode)''];
|
||||
command = ["rust-mode"];
|
||||
bindLocal = optionalAttrs (elem "emacs::company" config.machine.pkgs) {
|
||||
rust-mode-map = {
|
||||
"<tab>" = "company-indent-or-complete-common";
|
||||
};
|
||||
};
|
||||
config = ''
|
||||
(setq rust-rustfmt-bin "${rustEnv}/bin/rustfmt")
|
||||
(setq rust-format-on-save t)
|
||||
'';
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.cargo = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
};
|
||||
programs.emacs.init.usePackage.cargo = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
};
|
||||
|
||||
programs.emacs.init.usePackage.racer = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
hook = [
|
||||
''(racer-mode . (lambda () (eldoc-mode)))''
|
||||
] ++ optional (elem "emacs::company" config.machine.pkgs) ''(racer-mode . (lambda () (company-mode)))'';
|
||||
programs.emacs.init.usePackage.racer = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
hook =
|
||||
[
|
||||
''(racer-mode . (lambda () (eldoc-mode)))''
|
||||
]
|
||||
++ optional (elem "emacs::company" config.machine.pkgs) ''(racer-mode . (lambda () (company-mode)))'';
|
||||
|
||||
config = ''
|
||||
(setq racer-rust-src-path "${rustEnv}/lib/rustlib/src/rust/src")
|
||||
(setq racer-cmd "${rustEnv}/bin/racer")
|
||||
'';
|
||||
};
|
||||
}
|
||||
config = ''
|
||||
(setq racer-rust-src-path "${rustEnv}/lib/rustlib/src/rust/src")
|
||||
(setq racer-cmd "${rustEnv}/bin/racer")
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::solarized-theme" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.solarized-theme = {
|
||||
enable = true;
|
||||
config = "(load-theme 'solarized-dark t)";
|
||||
};
|
||||
}
|
||||
mkIf (elem "emacs::solarized-theme" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.solarized-theme = {
|
||||
enable = true;
|
||||
config = "(load-theme 'solarized-dark t)";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::telega" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.telegram = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
package = epkgs: [ epkgs.telega epkgs.visual-fill-column ];
|
||||
command = [ "telega" ];
|
||||
config = ''
|
||||
(telega-alert-mode 1)
|
||||
'';
|
||||
};
|
||||
}
|
||||
mkIf (elem "emacs::telega" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.telegram = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
package = epkgs: [epkgs.telega epkgs.visual-fill-column];
|
||||
command = ["telega"];
|
||||
config = ''
|
||||
(telega-alert-mode 1)
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,47 +1,50 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::transmission" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
transmission = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
command = [ "transmission" ];
|
||||
bindLocal = {
|
||||
transmission-mode-map = {
|
||||
"A" = ''(lambda ()
|
||||
(interactive)
|
||||
(transmission-add (read-string "Magnet URI: ")))'';
|
||||
mkIf (elem "emacs::transmission" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
transmission = {
|
||||
enable = true;
|
||||
defer = true;
|
||||
command = ["transmission"];
|
||||
bindLocal = {
|
||||
transmission-mode-map = {
|
||||
"A" = '' (lambda ()
|
||||
(interactive)
|
||||
(transmission-add (read-string "Magnet URI: ")))'';
|
||||
};
|
||||
};
|
||||
};
|
||||
config = ''
|
||||
;; Auto refresh for all transmission buffers
|
||||
(setq transmission-refresh-modes '(transmission-mode
|
||||
transmission-files-mode
|
||||
transmission-info-mode
|
||||
transmission-peers-mode))
|
||||
config = ''
|
||||
;; Auto refresh for all transmission buffers
|
||||
(setq transmission-refresh-modes '(transmission-mode
|
||||
transmission-files-mode
|
||||
transmission-info-mode
|
||||
transmission-peers-mode))
|
||||
|
||||
(defun transmission ()
|
||||
"Open a `transmission-mode' buffer."
|
||||
(interactive)
|
||||
(let* ((name "*transmission*")
|
||||
(buffer (or (get-buffer name)
|
||||
(generate-new-buffer name))))
|
||||
(transmission-turtle-poll)
|
||||
(unless (eq buffer (current-buffer))
|
||||
(with-current-buffer buffer
|
||||
(unless (eq major-mode 'transmission-mode)
|
||||
(condition-case e
|
||||
(progn
|
||||
(transmission-mode)
|
||||
(revert-buffer)
|
||||
(goto-char (point-min)))
|
||||
(error
|
||||
(kill-buffer buffer)
|
||||
(signal (car e) (cdr e))))))
|
||||
(switch-to-buffer buffer))))
|
||||
'';
|
||||
(defun transmission ()
|
||||
"Open a `transmission-mode' buffer."
|
||||
(interactive)
|
||||
(let* ((name "*transmission*")
|
||||
(buffer (or (get-buffer name)
|
||||
(generate-new-buffer name))))
|
||||
(transmission-turtle-poll)
|
||||
(unless (eq buffer (current-buffer))
|
||||
(with-current-buffer buffer
|
||||
(unless (eq major-mode 'transmission-mode)
|
||||
(condition-case e
|
||||
(progn
|
||||
(transmission-mode)
|
||||
(revert-buffer)
|
||||
(goto-char (point-min)))
|
||||
(error
|
||||
(kill-buffer buffer)
|
||||
(signal (car e) (cdr e))))))
|
||||
(switch-to-buffer buffer))))
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::undo-tree" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.undo-tree = {
|
||||
enable = true;
|
||||
hook = [ "(after-init . global-undo-tree-mode)" ];
|
||||
config = ''
|
||||
(setq undo-tree-visualizer-diff 't)
|
||||
(setq undo-tree-auto-save-history 't)
|
||||
(setq undo-tree-enable-undo-in-region 't)
|
||||
(setq undo-tree-history-directory-alist '(("." . "~/.emacs_undo")))
|
||||
'';
|
||||
};
|
||||
}
|
||||
mkIf (elem "emacs::undo-tree" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.undo-tree = {
|
||||
enable = true;
|
||||
hook = ["(after-init . global-undo-tree-mode)"];
|
||||
config = ''
|
||||
(setq undo-tree-visualizer-diff 't)
|
||||
(setq undo-tree-auto-save-history 't)
|
||||
(setq undo-tree-enable-undo-in-region 't)
|
||||
(setq undo-tree-history-directory-alist '(("." . "~/.emacs_undo")))
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,98 +1,100 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::web-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
web-mode = {
|
||||
enable = true;
|
||||
init = "(require 'sgml-mode)";
|
||||
hook = [
|
||||
"(web-mode . (lambda () (sgml-electric-tag-pair-mode)))"
|
||||
''
|
||||
(web-mode . (lambda ()
|
||||
(when (and (buffer-file-name)
|
||||
(equal (file-name-extension (buffer-file-name)) "svelte"))
|
||||
(lsp))))
|
||||
''
|
||||
];
|
||||
# bind = {};
|
||||
mode = [
|
||||
''("\\.html\\'" . web-mode)''
|
||||
''("\\.css\\'" . web-mode)''
|
||||
''("\\.html?\\'" . web-mode)''
|
||||
''("\\.svelte\\'" . web-mode)''
|
||||
''("\\.phtml\\'" . web-mode)''
|
||||
''("\\.tpl\\.php\\'" . web-mode)''
|
||||
''("\\.[agj]sp\\'" . web-mode)''
|
||||
''("\\.as[cp]x\\'" . web-mode)''
|
||||
''("\\.erb\\'" . web-mode)''
|
||||
''("\\.mustache\\'" . web-mode)''
|
||||
''("\\.djhtml\\'" . web-mode)''
|
||||
];
|
||||
config = ''
|
||||
(setq web-mode-markup-indent-offset 2)
|
||||
(setq web-mode-css-indent-offset 2)
|
||||
(setq web-mode-code-indent-offset 2)
|
||||
(setq web-mode-sql-indent-offset 2)
|
||||
(setq web-mode-script-padding 2)
|
||||
(setq web-mode-style-padding 2)
|
||||
(setq web-mode-part-padding 2)
|
||||
(setq web-mode-block-padding 2)
|
||||
(setq web-mode-enable-comment-annotation 't)
|
||||
|
||||
mkIf (elem "emacs::web-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
web-mode = {
|
||||
enable = true;
|
||||
init = "(require 'sgml-mode)";
|
||||
hook = [
|
||||
"(web-mode . (lambda () (sgml-electric-tag-pair-mode)))"
|
||||
''
|
||||
(web-mode . (lambda ()
|
||||
(when (and (buffer-file-name)
|
||||
(equal (file-name-extension (buffer-file-name)) "svelte"))
|
||||
(lsp))))
|
||||
''
|
||||
];
|
||||
# bind = {};
|
||||
mode = [
|
||||
''("\\.html\\'" . web-mode)''
|
||||
''("\\.css\\'" . web-mode)''
|
||||
''("\\.html?\\'" . web-mode)''
|
||||
''("\\.svelte\\'" . web-mode)''
|
||||
''("\\.phtml\\'" . web-mode)''
|
||||
''("\\.tpl\\.php\\'" . web-mode)''
|
||||
''("\\.[agj]sp\\'" . web-mode)''
|
||||
''("\\.as[cp]x\\'" . web-mode)''
|
||||
''("\\.erb\\'" . web-mode)''
|
||||
''("\\.mustache\\'" . web-mode)''
|
||||
''("\\.djhtml\\'" . web-mode)''
|
||||
];
|
||||
config = ''
|
||||
(setq web-mode-markup-indent-offset 2)
|
||||
(setq web-mode-css-indent-offset 2)
|
||||
(setq web-mode-code-indent-offset 2)
|
||||
(setq web-mode-sql-indent-offset 2)
|
||||
(setq web-mode-script-padding 2)
|
||||
(setq web-mode-style-padding 2)
|
||||
(setq web-mode-part-padding 2)
|
||||
(setq web-mode-block-padding 2)
|
||||
(setq web-mode-enable-comment-annotation 't)
|
||||
(setq web-mode-enable-current-element-highlight 't)
|
||||
|
||||
(setq web-mode-enable-current-element-highlight 't)
|
||||
(setq web-mode-enable-sql-detection 't)
|
||||
(setq web-mode-auto-close-style 2)
|
||||
|
||||
(setq web-mode-enable-sql-detection 't)
|
||||
(setq web-mode-auto-close-style 2)
|
||||
|
||||
(setq web-mode-engines-alist
|
||||
'(("php" . "\\.phtml\\'")
|
||||
("blade" . "\\.blade\\."))
|
||||
)
|
||||
'';
|
||||
(setq web-mode-engines-alist
|
||||
'(("php" . "\\.phtml\\'")
|
||||
("blade" . "\\.blade\\."))
|
||||
)
|
||||
'';
|
||||
};
|
||||
js2-mode = {
|
||||
enable = true;
|
||||
mode = [
|
||||
''("\\.js\\'" . js2-mode)''
|
||||
];
|
||||
};
|
||||
typescript-mode = {
|
||||
enable = true;
|
||||
hook =
|
||||
["(typescript-mode . (lambda () (subword-mode)))"]
|
||||
++ lib.optional (elem "emacs::lsp" config.machine.pkgs)
|
||||
''(typescript-mode . (lambda () (lsp)))'';
|
||||
mode = [
|
||||
''("\\.ts\\'" . typescript-mode)''
|
||||
''("\\.tsx?\\'" . typescript-tsx-mode)''
|
||||
];
|
||||
init = ''
|
||||
(define-derived-mode typescript-tsx-mode typescript-mode "tsx")
|
||||
'';
|
||||
config = ''
|
||||
(setq typescript-indent-level 2)
|
||||
'';
|
||||
};
|
||||
# https://github.com/NixOS/nixpkgs/pull/150239
|
||||
tree-sitter = {
|
||||
enable = true;
|
||||
package = epkgs: [epkgs.tree-sitter (epkgs.tree-sitter-langs.withPlugins (p: epkgs.tree-sitter-langs.plugins ++ [p.tree-sitter-markdown p.tree-sitter-tsx]))];
|
||||
hook = [
|
||||
"(typescript-mode . tree-sitter-hl-mode)"
|
||||
"(typescript-tsx-mode . tree-sitter-hl-mode)"
|
||||
];
|
||||
config = ''
|
||||
(tree-sitter-require 'tsx)
|
||||
(add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))
|
||||
'';
|
||||
};
|
||||
impatient-mode = {
|
||||
enable = true;
|
||||
};
|
||||
simple-httpd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
js2-mode = {
|
||||
enable = true;
|
||||
mode = [
|
||||
''("\\.js\\'" . js2-mode)''
|
||||
];
|
||||
};
|
||||
typescript-mode = {
|
||||
enable = true;
|
||||
hook = [ "(typescript-mode . (lambda () (subword-mode)))" ]
|
||||
++ lib.optional (elem "emacs::lsp" config.machine.pkgs)
|
||||
''(typescript-mode . (lambda () (lsp)))'';
|
||||
mode = [
|
||||
''("\\.ts\\'" . typescript-mode)''
|
||||
''("\\.tsx?\\'" . typescript-tsx-mode)''
|
||||
];
|
||||
init = ''
|
||||
(define-derived-mode typescript-tsx-mode typescript-mode "tsx")
|
||||
'';
|
||||
config = ''
|
||||
(setq typescript-indent-level 2)
|
||||
'';
|
||||
};
|
||||
# https://github.com/NixOS/nixpkgs/pull/150239
|
||||
tree-sitter = {
|
||||
enable = true;
|
||||
package = (epkgs: [ epkgs.tree-sitter (epkgs.tree-sitter-langs.withPlugins(p: epkgs.tree-sitter-langs.plugins ++ [ p.tree-sitter-markdown p.tree-sitter-tsx ]))]);
|
||||
hook = [
|
||||
"(typescript-mode . tree-sitter-hl-mode)"
|
||||
"(typescript-tsx-mode . tree-sitter-hl-mode)"
|
||||
];
|
||||
config = ''
|
||||
(tree-sitter-require 'tsx)
|
||||
(add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))
|
||||
'';
|
||||
|
||||
};
|
||||
impatient-mode = {
|
||||
enable = true;
|
||||
};
|
||||
simple-httpd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::yaml-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
yaml-mode = {
|
||||
enable = true;
|
||||
mkIf (elem "emacs::yaml-mode" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
yaml-mode = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,21 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "emacs::yasnippet" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
yasnippet = {
|
||||
enable = true;
|
||||
hook = ["(after-init . yas-global-mode)"];
|
||||
# config = ''
|
||||
|
||||
mkIf (elem "emacs::yasnippet" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage = {
|
||||
yasnippet = {
|
||||
enable = true;
|
||||
hook = [ "(after-init . yas-global-mode)" ];
|
||||
# config = ''
|
||||
|
||||
# '';
|
||||
# '';
|
||||
};
|
||||
yasnippet-snippets = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
yasnippet-snippets = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.extra.pkgs = with pkgs; [
|
||||
alsaUtils
|
||||
binutils-unwrapped
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config.machine.pkgsets.haskell-tools.pkgs = with pkgs; [ cabal-install hlint ]; # ghcid
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.haskell-tools.pkgs = with pkgs; [cabal-install hlint]; # ghcid
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
{
|
||||
config.machine.pkgsets.haskell.pkgwrap = (pkgs.haskellPackages.ghcWithPackages (pkgs: (fn.pkgFilter config.machine.pkgsets.haskell.pkgs)));
|
||||
config,
|
||||
lib,
|
||||
fn,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.haskell.pkgwrap = pkgs.haskellPackages.ghcWithPackages (pkgs: (fn.pkgFilter config.machine.pkgsets.haskell.pkgs));
|
||||
config.machine.pkgsets.haskell.pkgs = with pkgs.haskellPackages; [
|
||||
hindent
|
||||
mtl
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config.machine.pkgsets.latex.pkgs = with pkgs; [
|
||||
texlive.combined.scheme-full
|
||||
texlab
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.mail_utils.pkgs = with pkgs; [
|
||||
fetchmail
|
||||
isync
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config.machine.pkgsets.nodejs.pkgs = (with pkgs; [ nodejs yarn deno esbuild ]) ++
|
||||
(with pkgs.nodePackages; [
|
||||
autoprefixer
|
||||
browserify
|
||||
create-react-app
|
||||
degit
|
||||
mermaid-cli
|
||||
parcel-bundler
|
||||
prettier
|
||||
prisma
|
||||
rollup
|
||||
serve
|
||||
svelte-check
|
||||
svelte-language-server
|
||||
tailwindcss
|
||||
ts-node
|
||||
typescript
|
||||
typescript-language-server
|
||||
webpack
|
||||
webpack-cli
|
||||
]);
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.nodejs.pkgs =
|
||||
(with pkgs; [nodejs yarn deno esbuild])
|
||||
++ (with pkgs.nodePackages; [
|
||||
autoprefixer
|
||||
browserify
|
||||
create-react-app
|
||||
degit
|
||||
mermaid-cli
|
||||
parcel-bundler
|
||||
prettier
|
||||
prisma
|
||||
rollup
|
||||
serve
|
||||
svelte-check
|
||||
svelte-language-server
|
||||
tailwindcss
|
||||
ts-node
|
||||
typescript
|
||||
typescript-language-server
|
||||
webpack
|
||||
webpack-cli
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
{
|
||||
config.machine.pkgsets.php.pkgwrap = (fn.pkgFilter config.machine.pkgsets.php.pkgs);
|
||||
config.machine.pkgsets.php.pkgs = (with pkgs.php82Packages; [
|
||||
composer
|
||||
]) ++ (with pkgs; [ php82 ]);
|
||||
config,
|
||||
lib,
|
||||
fn,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.php.pkgwrap = fn.pkgFilter config.machine.pkgsets.php.pkgs;
|
||||
config.machine.pkgsets.php.pkgs =
|
||||
(with pkgs.php82Packages; [
|
||||
composer
|
||||
])
|
||||
++ (with pkgs; [php82]);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config.machine.pkgsets.python3.pkgwrap = (pkgs.python310.withPackages (ps: (fn.pkgFilter config.machine.pkgsets.python3.pkgs)));
|
||||
config,
|
||||
lib,
|
||||
fn,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config.machine.pkgsets.python3.pkgwrap = pkgs.python310.withPackages (ps: (fn.pkgFilter config.machine.pkgsets.python3.pkgs));
|
||||
config.machine.pkgsets.python3.pkgs = with pkgs.python310Packages; [
|
||||
GitPython
|
||||
bpython
|
||||
|
@ -13,7 +16,8 @@ with lib;
|
|||
epc
|
||||
flake8
|
||||
genanki
|
||||
matplotlib ipywidgets
|
||||
matplotlib
|
||||
ipywidgets
|
||||
python-docx
|
||||
mypy
|
||||
numpy
|
||||
|
@ -29,7 +33,8 @@ with lib;
|
|||
pypdf2
|
||||
# pygame pygame_sdl2
|
||||
pylama
|
||||
pylint toml
|
||||
pylint
|
||||
toml
|
||||
pyopengl
|
||||
pyproj
|
||||
pytest
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
{ config, ... }:
|
||||
|
||||
let
|
||||
mozRust = with builtins; (map (p: import ((fetchTarball {
|
||||
url = "https://github.com/mozilla/nixpkgs-mozilla/archive/e912ed4.tar.gz";
|
||||
sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3";
|
||||
}) + p))) [
|
||||
(toPath "/lib-overlay.nix")
|
||||
(toPath "/rust-overlay.nix")
|
||||
];
|
||||
stablepkgs = import <nixos-stable> { overlays = mozRust;};
|
||||
{config, ...}: let
|
||||
mozRust = with builtins;
|
||||
(map (p:
|
||||
import ((fetchTarball {
|
||||
url = "https://github.com/mozilla/nixpkgs-mozilla/archive/e912ed4.tar.gz";
|
||||
sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3";
|
||||
})
|
||||
+ p))) [
|
||||
(toPath "/lib-overlay.nix")
|
||||
(toPath "/rust-overlay.nix")
|
||||
];
|
||||
stablepkgs = import <nixos-stable> {overlays = mozRust;};
|
||||
|
||||
# https://rust-lang.github.io/rustup-components-history
|
||||
nightly = stablepkgs.rustChannelOf {
|
||||
|
@ -16,24 +17,28 @@ let
|
|||
channel = "nightly";
|
||||
};
|
||||
rustNightly = {
|
||||
rustc = nightly.rust.override {
|
||||
extensions = [
|
||||
"clippy-preview"
|
||||
"rls-preview"
|
||||
"rust-analysis"
|
||||
"rust-src"
|
||||
"rustfmt-preview"
|
||||
]; } // { src = nightly.rust-src; };
|
||||
rustc =
|
||||
nightly.rust.override {
|
||||
extensions = [
|
||||
"clippy-preview"
|
||||
"rls-preview"
|
||||
"rust-analysis"
|
||||
"rust-src"
|
||||
"rustfmt-preview"
|
||||
];
|
||||
}
|
||||
// {src = nightly.rust-src;};
|
||||
cargo = nightly.cargo;
|
||||
};
|
||||
rustPNightly = stablepkgs.recurseIntoAttrs (stablepkgs.makeRustPlatform {
|
||||
rustPNightly = stablepkgs.recurseIntoAttrs (stablepkgs.makeRustPlatform {
|
||||
inherit (rustNightly) rustc cargo;
|
||||
});
|
||||
|
||||
in {
|
||||
config.machine.pkgsets.rustpkgs.pkgs = (with stablepkgs; [
|
||||
diesel-cli
|
||||
carnix
|
||||
rustracer
|
||||
]) ++ (with rustNightly; [ rustc cargo]);
|
||||
config.machine.pkgsets.rustpkgs.pkgs =
|
||||
(with stablepkgs; [
|
||||
diesel-cli
|
||||
carnix
|
||||
rustracer
|
||||
])
|
||||
++ (with rustNightly; [rustc cargo]);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.server.pkgs = with pkgs; [
|
||||
audit
|
||||
certbot
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config.machine.pkgsets.tracking.pkgs = with pkgs; [
|
||||
aw-qt
|
||||
aw-server-rust
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config.machine.pkgsets.uniProgs.pkgs = with pkgs; [ qucs ];
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config.machine.pkgsets.uniProgs.pkgs = with pkgs; [qucs];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.machine;
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.machine;
|
||||
in {
|
||||
config.machine.pkgsets.xpkgs.pkgs = with pkgs; [
|
||||
acpilight
|
||||
|
@ -13,7 +15,9 @@ in {
|
|||
gnome3.gvfs
|
||||
gvfs
|
||||
oneko
|
||||
pcmanfm lxmenu-data shared-mime-info
|
||||
pcmanfm
|
||||
lxmenu-data
|
||||
shared-mime-info
|
||||
pavucontrol
|
||||
xclip
|
||||
xorg.xkill
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue