I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2481 lines
71 KiB

4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
  1. #+TITLE: Dotfiles
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+EXPORT_FILE_NAME: dotfiles
  5. #+ROAM_KEY: https://chrishayward.xyz/dotfiles
  6. #+HUGO_BASE_DIR: docs
  7. #+HUGO_AUTO_SET_LASTMOD: t
  8. #+HUGO_SECTION:
  9. #+HUGO_DRAFT: false
  10. #+NAME: description
  11. #+BEGIN_SRC text
  12. Immutable NixOS dotfiles.
  13. #+END_SRC
  14. Built for Life, Liberty, and the Open Road.
  15. + 100% Immutable
  16. + 100% Declarative
  17. + 100% Reproducible
  18. * Introduction
  19. This is my personal configuration(s) for GNU/Linux[fn:1] systems. It enables a consistent experience and computing environment across all of my machines. This project is written with GNU/Emacs[fn:2], leveraging its capabilities for Literate Programming[fn:3], a technique where programs are written in a natural language, such as English, interspersed with snippets of code to describe a software project.
  20. #+NAME: file-warning
  21. #+BEGIN_SRC text
  22. This file is controlled by /etc/dotfiles/README.org
  23. #+END_SRC
  24. ** Getting Started
  25. 1) Download the latest version of NixOS https://nixos.org/download.html
  26. 2) Partition drives and mount the file system https://nixos.org/manual/nixos/stable/#sec-installation-partitioning
  27. 3) Clone the project to =/mnt/etc/dotfiles= ~git clone git@git.chrishayward.xyz:chris/dotfiles /mnt/etc/dotfiles~
  28. 4) Load the default shell environment ~nix-shell /mnt/etc/dotfiles~
  29. 5) Install the default system ~sudo nixos-install --flake /mnt/etc/dotfiles#nixos~
  30. 6) Reboot and login, start a graphical system with ~startx~
  31. ** Making Changes
  32. The ~nixos-rebuild~ command updates the system so that it corresponds to the configuration specified in the module. It builds the new system in =/nix/store/=, runs the activation scripts, and restarts and system services (if needed). The command has one required argument, which specifies the desired operation:
  33. + switch :: Build and activate the new configuration, making it the new boot default
  34. + boot :: Build the new configuration and make it the boot default, without activation
  35. + test :: Build and activate the new configuration, without adding it to the boot menu
  36. + build :: Build the new configuration, without activation, nor adding it to the boot menu
  37. + build-vm :: Build a script that starts a virtual machine with the desired configuration
  38. #+BEGIN_SRC shell
  39. # Build and activate a new configuration.
  40. sudo nixos-rebuild switch --flake $FLAKE#$HOSTNAME
  41. #+END_SRC
  42. Instead of building a new configuration, it's possible to rollback to a previous generation using the ~nixos-rebuild~ command, by supplying the ~--rollback~ argument.
  43. #+BEGIN_SRC shell
  44. # Rollback to the previous generation.
  45. sudo nixos-rebuild switch --rollback
  46. #+END_SRC
  47. ** Docker Container
  48. It's possible to use parts of this configuration using the container. By default, sandboxing is turned /off/ inside of the container, even though it's enabled in new installations. This can lead to differences between derivations built inside containers, versus those built without any containerization. This is especially true if a derivation relies on sandboxing to block sideloading of dependencies.
  49. #+BEGIN_SRC conf :tangle Dockerfile
  50. # Derive from the official image.
  51. FROM nixos/nix
  52. # Add the unstable channel.
  53. RUN nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
  54. RUN nix-channel --update
  55. # Setup the default environment.
  56. WORKDIR /etc/dotfiles
  57. COPY . .
  58. # Load the default system shell.
  59. RUN nix-shell /etc/dotfiles
  60. #+END_SRC
  61. * Operating System
  62. NixOS[fn:4] is a purely functional Linux distribution built on top of the Nix[fn:5] package manager. It uses a declarative configuration language to define entire computer systems, and allows reliable system upgrades and rollbacks. NixOS[fn:4] also has tool dedicated to DevOps and deployment tasks, and makes it trivial to share development environments.
  63. #+BEGIN_SRC nix :noweb yes :tangle flake.nix
  64. # <<file-warning>>
  65. {
  66. description = "<<description>>";
  67. inputs = {
  68. <<os-nixpkgs>>
  69. <<os-home-manager>>
  70. <<os-emacs-overlay>>
  71. <<os-nixos-hardware>>
  72. <<os-nix-on-droid>>
  73. };
  74. outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }: {
  75. nixosConfigurations = {
  76. <<host-default>>
  77. <<host-acernitro>>
  78. <<host-android>>
  79. <<host-homecloud>>
  80. <<host-raspberry>>
  81. <<host-zero-one>>
  82. <<host-zero-two>>
  83. };
  84. };
  85. }
  86. #+END_SRC
  87. ** Nixpkgs
  88. Nixpkgs[fn:6] is a collection of over 60,000 software packages that can be installed with the Nix[fn:5] package manager. Two main branches are offered:
  89. 1) The current stable release
  90. 2) The Unstable branch following the latest development
  91. #+NAME: os-nixpkgs
  92. #+BEGIN_SRC nix
  93. nixpkgs.url = "nixpkgs/nixos-unstable";
  94. nixpkgs-unstable.url = "nixpkgs/master";
  95. #+END_SRC
  96. ** Home Manager
  97. Home Manager[fn:7] provides a basic system for managing user environments using the Nix[fn:5] package manager together with the Nix libraries found in Nixpkgs[fn:6]. It allows declarative configuration of user specific (non-global) packages and files.
  98. #+NAME: os-home-manager
  99. #+BEGIN_SRC nix
  100. home-manager.url = "github:nix-community/home-manager";
  101. home-manager.inputs.nixpkgs.follows = "nixpkgs";
  102. #+END_SRC
  103. ** Emacs Overlay
  104. Adding the Emacs Overlay[fn:8] extends the GNU/Emacs[fn:2] package set to contain the latest versions, and daily generations from popular package sources, including the needed dependencies to run GNU/Emacs[fn:2] as a Window Manager.
  105. #+NAME: os-emacs-overlay
  106. #+BEGIN_SRC nix
  107. emacs-overlay.url = "github:nix-community/emacs-overlay";
  108. #+END_SRC
  109. ** NixOS Hardware
  110. NixOS Hardware[fn:9] is a collection of NixOS[fn:4] modules covering specific hardware quirks. Unlike the channel, this will update the git repository on a rebuild. However, it's easy to pin particular revisions for more stability.
  111. #+NAME: os-nixos-hardware
  112. #+BEGIN_SRC nix
  113. nixos-hardware.url = "github:nixos/nixos-hardware";
  114. #+END_SRC
  115. ** Nix On Droid
  116. Nix On Droid[fn:10] is a deployment of the Nix[fn:5] Package Manager on Android, in a single-click installable package. It does not require =root=, user namespace support, or disabling SELinux, but relies on =proot=. It has no relation to the Termux distribution.
  117. #+NAME: os-nix-on-droid
  118. #+BEGIN_SRC nix
  119. nix-on-droid.url = "github:t184256/nix-on-droid/master";
  120. nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
  121. #+END_SRC
  122. * Host Configurations
  123. NixOS[fn:4] typically stores the current machine configuration in =/etc/nixos/configuration.nix=. In this project, this file is stored in =/etc/dotfiles/hosts/$HOSTNAME/...=, and imported, along with the generated hardware configurations. This ensures that multiple host machines can share the same modules, and generating new host definitions is trivial.
  124. ** Default
  125. The default host, built using QEMU[fn:11], a free and open-source emulator that can perform hardware virtualization. It features a lightweight system optimized for development, running GNU/Emacs[fn:2] + EXWM[fn:12] as the graphical environment.
  126. #+NAME: host-default
  127. #+BEGIN_SRC nix :noweb yes
  128. nixos = nixpkgs.lib.nixosSystem {
  129. system = "x86_64-linux";
  130. specialArgs = { inherit inputs; };
  131. modules = [
  132. ./hosts/nixos
  133. <<module-x11>>
  134. <<module-flakes>>
  135. <<module-cachix>>
  136. <<module-home-manager>>
  137. ];
  138. };
  139. #+END_SRC
  140. Deploy this configuration with ~nixos-rebuild switch --flake /etc/dotfiles/#nixos~.
  141. #+BEGIN_SRC nix :noweb yes :tangle hosts/nixos/default.nix
  142. # <<file-warning>>
  143. { ... }:
  144. {
  145. imports = [
  146. ./configuration.nix
  147. ./hardware.nix
  148. ];
  149. }
  150. #+END_SRC
  151. *** Configuration
  152. This is a basic default configuration that specified the indended default configuration of the system. Because NixOS[fn:4] has a declarative configuration model, you can create or edit a description of the desired configuration, and update it from one file.
  153. #+BEGIN_SRC nix :noweb yes :tangle hosts/nixos/configuration.nix
  154. # <<file-warning>>
  155. { config, pkgs, inputs, ... }:
  156. {
  157. boot.loader.grub.enable = true;
  158. boot.loader.grub.version = 2;
  159. boot.loader.grub.device = "/dev/sda";
  160. time.timeZone = "America/Toronto";
  161. networking.hostName = "nixos";
  162. networking.useDHCP = false;
  163. networking.firewall.enable = false;
  164. networking.interfaces.ens3.useDHCP = true;
  165. programs.mtr.enable = true;
  166. programs.fish.enable = true;
  167. programs.gnupg.agent.enable = true;
  168. users.users.chris = {
  169. shell = pkgs.fish;
  170. isNormalUser = true;
  171. extraGroups = [ "wheel" ];
  172. };
  173. }
  174. #+END_SRC
  175. *** Hardware
  176. The file system for this host is a single 24GB QCOW file, a format for disk images used by QEMU[fn:11]. The file can be recreated easily by following the steps listed in the NixOS[fn:4] installation manual, specifically the section on disk formatting.
  177. #+BEGIN_SRC nix :noweb yes :tangle hosts/nixos/hardware.nix
  178. # <<file-warning>>
  179. { config, lib, pkgs, modulesPath, ... }:
  180. {
  181. imports =
  182. [ (modulesPath + "/profiles/qemu-guest.nix")
  183. ];
  184. boot.initrd.availableKernelModules = [ "ata_piix" "floppy" "sd_mod" "sr_mod" ];
  185. boot.initrd.kernelModules = [ ];
  186. boot.kernelModules = [ ];
  187. boot.extraModulePackages = [ ];
  188. fileSystems."/" =
  189. { device = "/dev/disk/by-uuid/fddc37ff-a442-41fa-afc4-abf878be7c5a";
  190. fsType = "ext4";
  191. };
  192. swapDevices =
  193. [ { device = "/dev/disk/by-uuid/5fc0e3df-e796-4fe2-8482-c6acaed9d36f"; }
  194. ];
  195. }
  196. #+END_SRC
  197. ** Acernitro
  198. My gaming laptop, the model is an Acer Nitro AN-515-53[fn:13]. The Nitro 5 has more in common with the mid-range notebooks rather than the gaming models due to its cooling design, chassis, and overall construction.
  199. Here are the specs:
  200. | Slot | Component |
  201. |---------+---------------------------------------|
  202. | CPU | Intel Core i5-8300H |
  203. | GPU | NVIDIA GeForce GTX 1050Ti (4GB GDDR5) |
  204. | RAM | 16GB DDR4 |
  205. | Display | 15.6" Full HD (1920 x 1080), IPS |
  206. | Storage | 1000GB HDD |
  207. | Weight | 2.48kg (5.5 lbs) |
  208. #+NAME: host-acernitro
  209. #+BEGIN_SRC nix :noweb yes
  210. acernitro = nixpkgs.lib.nixosSystem {
  211. system = "x86_64-linux";
  212. specialArgs = { inherit inputs; };
  213. modules = [
  214. ./hosts/acernitro
  215. <<module-x11>>
  216. <<module-flakes>>
  217. <<module-cachix>>
  218. <<module-firefox>>
  219. <<module-moonlight>>
  220. <<module-teamviewer>>
  221. <<module-home-manager>>
  222. ];
  223. };
  224. #+END_SRC
  225. Deploy this configuration with ~nixos-rebuild switch --flake /etc/dotfiles/#acernitro~.
  226. #+BEGIN_SRC nix :noweb yes :tangle hosts/acernitro/default.nix
  227. # <<file-warning>>
  228. { ... }:
  229. {
  230. imports = [
  231. ./configuration.nix
  232. ./hardware.nix
  233. ];
  234. }
  235. #+END_SRC
  236. *** Configuration
  237. This configuration is nearly identical to the default, except for a few key differences:
  238. + Enables sound
  239. + Applies the desired hostname
  240. + It adds support for =UEFI= systems
  241. + Enables support for wireless networking
  242. #+BEGIN_SRC nix :noweb yes :tangle hosts/acernitro/configuration.nix
  243. # <<file-warning>>
  244. { config, pkgs, inputs, ... }:
  245. {
  246. boot.loader.systemd-boot.enable = true;
  247. boot.loader.efi.canTouchEfiVariables = true;
  248. time.timeZone = "America/Toronto";
  249. networking.hostName = "acernitro";
  250. networking.firewall.enable = false;
  251. networking.wireless.enable = true;
  252. networking.wireless.userControlled.enable = true;
  253. networking.useDHCP = false;
  254. networking.interfaces.enp6s0f1.useDHCP = true;
  255. networking.interfaces.wlp0s20f3.useDHCP = true;
  256. # Pre-configured wireless networks.
  257. networking.wireless.networks.MyWiFi_5C1870.pskRaw =
  258. "409b3c85fef1c5737f284d2f82f20dc6023e41804e862d4fa26265ef8193b326";
  259. services.openssh.enable = true;
  260. services.printing.enable = true;
  261. programs.mtr.enable = true;
  262. programs.fish.enable = true;
  263. programs.gnupg.agent.enable = true;
  264. users.users.chris = {
  265. shell = pkgs.fish;
  266. isNormalUser = true;
  267. extraGroups = [ "wheel" ];
  268. };
  269. }
  270. #+END_SRC
  271. *** Hardware
  272. + Override the default =DPI=
  273. + Enables sound via PulseAudio
  274. + Adds support for the NVIDIA Hybrid GPU
  275. #+BEGIN_SRC nix :noweb yes :tangle hosts/acernitro/hardware.nix
  276. # <<file-warning>>
  277. { config, lib, pkgs, modulesPath, ... }:
  278. {
  279. imports =
  280. [ (modulesPath + "/installer/scan/not-detected.nix")
  281. ];
  282. boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
  283. boot.initrd.kernelModules = [ ];
  284. boot.kernelModules = [ "kvm-intel" ];
  285. boot.extraModulePackages = [ ];
  286. sound.enable = true;
  287. hardware.pulseaudio.enable = true;
  288. hardware.pulseaudio.support32Bit = true;
  289. services.xserver.dpi = 96;
  290. fileSystems."/" =
  291. { device = "/dev/disk/by-uuid/2f548eb9-47ce-4280-950f-9c6d1d162852";
  292. fsType = "ext4";
  293. };
  294. fileSystems."/boot" =
  295. { device = "/dev/disk/by-uuid/5BC3-73F3";
  296. fsType = "vfat";
  297. };
  298. swapDevices =
  299. [ { device = "/dev/disk/by-uuid/bef7bf62-d26f-45b1-a1f8-1227c2f8b26a"; }
  300. ];
  301. powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
  302. }
  303. #+END_SRC
  304. ** Android
  305. This is my Samsung Galaxy S10+[fn:14] running Nix On Droid[fn:10] with the experimental support for Flakes being used to manage the configuration.
  306. #+NAME: host-android
  307. #+BEGIN_SRC nix
  308. android = (inputs.nix-on-droid.lib.aarch64-linux.nix-on-droid {
  309. config = ./hosts/android/nix-on-droid.nix;
  310. }).activationPackage;
  311. #+END_SRC
  312. Build the activation package with ~nix build .#android --impure~, and activate it with =result/activate=.
  313. #+BEGIN_SRC nix :noweb yes :tangle hosts/android/nix-on-droid.nix
  314. # <<file-warning>>
  315. { pkgs, ... }:
  316. {
  317. environment.packages = [
  318. pkgs.git
  319. pkgs.vim
  320. pkgs.pass
  321. pkgs.gnupg
  322. pkgs.openssh
  323. ];
  324. }
  325. #+END_SRC
  326. ** TODO Homecloud
  327. The Raspberry Pi Model B-8GB[fn:15] is the latest product in the popular Raspberry Pi range of computers. It offers groundbreaking increases in processor speed, multimedia performance, memory, and connectivity compared to the prior generation. On NixOS[fn:4], the Raspberry Pi family is /only/ supported on the =AArch64= platform, although there is community support for =armv6l= and =armv7l=.
  328. #+NAME: host-homecloud
  329. #+BEGIN_SRC nix
  330. homecloud = nixpkgs.lib.nixosSystem {
  331. system = "aarch64-linux";
  332. specialArgs = { inherit inputs; };
  333. modules = [
  334. ./hosts/homecloud
  335. <<module-flakes>>
  336. <<module-cachix>>
  337. <<module-jellyfin>>
  338. ];
  339. };
  340. #+END_SRC
  341. Deploy this configuration with ~sudo nixos-rebuild switch --flake /etc/dotfiles/#homecloud~.
  342. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/default.nix
  343. # <<file-warning>
  344. { ... }:
  345. {
  346. imports = [
  347. ./configuration.nix
  348. ./hardware.nix
  349. ];
  350. }
  351. #+END_SRC
  352. *** TODO Configuration
  353. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/configuration.nix
  354. # <<file-warning>>
  355. { # TODO
  356. }
  357. #+END_SRC
  358. *** TODO Hardware
  359. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/hardware.nix
  360. # <<file-warning>>
  361. { # TODO
  362. }
  363. #+END_SRC
  364. ** TODO Raspberry
  365. The Raspberry Pi 400[fn:16] is your complete personal computer, built into a compact keyboard. It features a quad-core, 64-bit processor, 4GB of RAM, wireless networking, dual-display output, 4k video playback, as well as a 40-pin GPIO header. It's the most powerful Raspberry Pi computer yet.
  366. #+NAME: host-raspberry
  367. #+BEGIN_SRC nix :noweb yes
  368. raspberry = nixpkgs.lib.nixosSystem {
  369. system = "aarch64-linux";
  370. specialArgs = { inherit inputs; };
  371. modules = [
  372. ./hosts/raspberry
  373. <<module-flakes>>
  374. <<module-cachix>>
  375. ];
  376. };
  377. #+END_SRC
  378. Deploy this configuration with ~sudo nixos-rebuild switch --flake /etc/dotfiles/#raspberry~.
  379. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/default.nix
  380. # <<file-warning>>
  381. { ... }:
  382. {
  383. imports = [
  384. ./configuration.nix
  385. ./hardware.nix
  386. ];
  387. }
  388. #+END_SRC
  389. *** TODO Configuration
  390. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/configuration.nix
  391. # <<file-warning>>
  392. { # TODO
  393. }
  394. #+END_SRC
  395. *** TODO Hardware
  396. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/hardware.nix
  397. # <<file-warning>>
  398. { # TODO
  399. }
  400. #+END_SRC
  401. ** TODO Zero-One
  402. TODO: Raspberry Pi Zero/Zero WH
  403. #+NAME: host-zero-one
  404. #+BEGIN_SRC nix
  405. zero-one = nixpkgs.lib.nixosSystem {
  406. system = "armv7l-linux";
  407. specialArgs = { inherit inputs; };
  408. modules = [
  409. ./hosts/zero-one
  410. ./modules/flakes.nix
  411. ./modules/cachix.nix
  412. ];
  413. };
  414. #+END_SRC
  415. ** TODO Zero-Two
  416. #+NAME: host-zero-two
  417. #+BEGIN_SRC nix
  418. zero-two = nixpkgs.lib.nixosSystem {
  419. system = "armv7l-linux";
  420. specialArgs = { inherit inputs; };
  421. modules = [
  422. ./hosts/zero-one
  423. ./modules/flakes.nix
  424. ./modules/cachix.nix
  425. ];
  426. };
  427. #+END_SRC
  428. * Development Shells
  429. The command ~nix-shell~[fn:17] will build the dependencies of the specified derivation, but not the derivation itself. It will then start an interactive shell in which all environment variables defined by the derivation /path/ have been set to their corresponding values.
  430. Import this shell with ~nix-shell /etc/dotfiles/shell.nix~.
  431. #+BEGIN_SRC nix :noweb yes :tangle shell.nix
  432. # <<file-warning>>
  433. { pkgs ? import <nixpkgs> { } }:
  434. with pkgs;
  435. let
  436. nixBin = writeShellScriptBin "nix" ''
  437. ${nixFlakes}/bin/nix --option experimental-features "nix-command flakes" "$@"
  438. '';
  439. in mkShell {
  440. buildInputs = [
  441. git
  442. ];
  443. shellHook = ''
  444. export FLAKE="$(pwd)"
  445. export PATH="$FLAKE/bin:${nixBin}/bin:$PATH"
  446. '';
  447. }
  448. #+END_SRC
  449. ** Go
  450. Go[fn:18] is an open-source programming language that makes it easy to build simple, reliable, and efficient software. It's statically typed and compiled programming language. It's syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency.
  451. Import this shell with ~nix-shell /etc/dotfiles/shells/go.nix~
  452. #+BEGIN_SRC nix :noweb yes :tangle shells/go.nix
  453. # <<file-warning>>
  454. { pkgs ? import <nixpkgs> { } }:
  455. with pkgs;
  456. mkShell {
  457. buildInputs = [
  458. go
  459. gopls
  460. protoc-gen-go-grpc
  461. ];
  462. shellHook = ''
  463. export GO111MODULE=on
  464. export GOPATH=$HOME/.go/
  465. export PATH=$GOPATH/bin:$PATH
  466. '';
  467. }
  468. #+END_SRC
  469. ** gRPC
  470. gRPC[fn:19] is a modern open-source, high-performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centres with pluggable support for load balancing, tracing, health checking, and authentication.
  471. Import this shell with ~nix-shell /etc/dotfiles/shells/grpc.nix~
  472. #+BEGIN_SRC nix :noweb yes :tangle shells/grpc.nix
  473. # <<file-warning>>
  474. { pkgs ? import <nixpkgs> { } }:
  475. with pkgs;
  476. mkShell {
  477. buildInputs = [
  478. grpc
  479. grpc-tools
  480. grpcui
  481. grpcurl
  482. ];
  483. shellHook = ''
  484. '';
  485. }
  486. #+END_SRC
  487. ** C/C++
  488. C[fn:20] is a general-purpose, procedural computer programming language support structured programming, lexical variable scope, and recursion. It has a static type system, and by design provides constructs that map efficiently to typical machine instructions. C++[fn:21] is a general-purpose programming language created as an extension of the C[fn:20] programming language.
  489. Import this shell with ~nix-shell /etc/dotfiles/shells/cc.nix~
  490. #+BEGIN_SRC nix :noweb yes :tangle shells/cc.nix
  491. # <<file-warning>>
  492. { pkgs ? import <nixpkgs> { } }:
  493. with pkgs;
  494. mkShell {
  495. buildInputs = [
  496. ccls
  497. gnumake
  498. libstdcxx5
  499. gcc-unwrapped
  500. ];
  501. shellHook = ''
  502. '';
  503. }
  504. #+END_SRC
  505. ** Python
  506. Python[fn:22] is an interpreted high-level, general-purpose programming language. Its design philosophy emphasizes code readability, with its notable use of significant indentation. Its language constructs, as well as its object-oriented approach aim to help programmers write clear, logical, code for small and large projects.
  507. Import this shell with ~nix-shell /etc/dotfiles/shells/python.nix~
  508. #+BEGIN_SRC nix :noweb yes :tangle shells/python.nix
  509. # <<file-warning>>
  510. { pkgs ? import <nixpkgs> { } }:
  511. with pkgs;
  512. mkShell {
  513. buildInputs = [
  514. python39Packages.pip
  515. python39Packages.pip-tools
  516. python39Packages.pyls-mypy
  517. python39Packages.pyls-isort
  518. python39Packages.pyls-black
  519. ];
  520. shellHook = ''
  521. '';
  522. }
  523. #+END_SRC
  524. * Module Definitions
  525. Modules are files combined by NixOS[fn:4] to produce the full system configuration. Modules wre introduced to allow extending NixOS[fn:4] without modifying its source code. They also allow splitting up =configuration.nix=, making the system configuration easier to maintain and use.
  526. ** X11
  527. #+NAME: module-x11
  528. #+BEGIN_SRC nix
  529. ./modules/x11.nix
  530. #+END_SRC
  531. X11, or X[fn:23] is the generic name for the X Window System Display Server. All graphical GNU/Linux[fn:1] applications connect to an X-Window[fn:23] (or Wayland[fn:24]) to display graphical data on the monitor of a computer. Its a program that acts as the interface between graphical applications and the graphics subsystem of the computer.
  532. #+BEGIN_SRC nix :noweb yes :tangle modules/x11.nix
  533. # <<file-warning>>
  534. { config, pkgs, ... }:
  535. {
  536. services.xserver.enable = true;
  537. services.xserver.layout = "us";
  538. services.xserver.libinput.enable = true;
  539. services.xserver.displayManager.startx.enable = true;
  540. environment = {
  541. systemPackages = with pkgs; [
  542. pkgs.sqlite
  543. pkgs.pfetch
  544. pkgs.cmatrix
  545. pkgs.asciiquarium
  546. ];
  547. extraInit = ''
  548. export XAUTHORITY=/tmp/Xauthority
  549. export xserverauthfile=$XAUTHORITY
  550. [ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY"
  551. '';
  552. };
  553. services.picom.enable = true;
  554. services.openssh.enable = true;
  555. services.printing.enable = true;
  556. fonts.fonts = with pkgs; [
  557. iosevka
  558. emacs-all-the-icons-fonts
  559. ];
  560. }
  561. #+END_SRC
  562. ** Flakes
  563. #+NAME: module-flakes
  564. #+BEGIN_SRC nix
  565. ./modules/flakes.nix
  566. #+END_SRC
  567. Nix Flakes[fn:25] are an upcoming feature of the Nix package manager[fn:5]. They allow you to specify your codes dependencies in a declarative way, simply by listing them inside of a ~flake.nix~ file. Each dependency is then pinned to a specific git-hash. Flakes[fn:25] replace the =nix-channels= command and things like ~builtins.fetchGit~, keeping dependencies at the top of the tree, and channels always in sync. Currently, Flakes[fn:25] are not available unless explicitly enabled.
  568. #+BEGIN_SRC nix :noweb yes :tangle modules/flakes.nix
  569. # <<file-warning>>
  570. { config, pkgs, inputs, ... }:
  571. {
  572. nix = {
  573. package = pkgs.nixUnstable;
  574. extraOptions = ''
  575. experimental-features = nix-command flakes
  576. '';
  577. };
  578. nixpkgs = {
  579. config = { allowUnfree = true; };
  580. overlays = [ inputs.emacs-overlay.overlay ];
  581. };
  582. }
  583. #+END_SRC
  584. ** Cachix
  585. #+NAME: module-cachix
  586. #+BEGIN_SRC nix
  587. ./modules/cachix.nix
  588. #+END_SRC
  589. Cachix[fn:26] is a Command line client for Nix[fn:5] binary cache hosting. This allows downloading and usage of pre-compiled binaries for applications on /nearly/ every available system architecture. This speeds up the time it takes to rebuild configurations.
  590. #+BEGIN_SRC nix :noweb yes :tangle modules/cachix.nix
  591. # <<file-warning>>
  592. { config, ... }:
  593. {
  594. nix = {
  595. binaryCaches = [
  596. "https://nix-community.cachix.org"
  597. ];
  598. binaryCachePublicKeys = [
  599. "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
  600. ];
  601. };
  602. }
  603. #+END_SRC
  604. ** Firefox
  605. #+NAME: module-firefox
  606. #+BEGIN_SRC nix
  607. ./modules/firefox.nix
  608. #+END_SRC
  609. Firefox Browser[fn:27], also known as Mozilla Firefox or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. Firefox uses the Gecko layout engine to render web pages, which implements current and anticipated web standards. In 2017, Firefox began incorporating new technology under the code name Quantum to promote parallelism and a more intuitive user interface.
  610. #+BEGIN_SRC nix :noweb yes :tangle modules/firefox.nix
  611. # <<file-warning>>
  612. { pkgs, ... }:
  613. {
  614. # NOTE: Use the binary until module is developed.
  615. environment.systemPackages = [
  616. pkgs.firefox-bin
  617. ];
  618. }
  619. #+END_SRC
  620. ** Jellyfin
  621. #+NAME: module-jellyfin
  622. #+BEGIN_SRC nix
  623. ./modules/jellyfin.nix
  624. #+END_SRC
  625. Jellyfin[fn:28] is a suite of multimedia applications designed to organize, manage, and share digital media files to networked devices. It consists of a server application installed on a machine, and another application running as a client on devices such as Smartphones, Tablets, SmartTVs, Streaming Media Players, Game Consoles, or in a Web Browser. It can also serve media to DLNA and Chromecast enabled devices. It's free and open-source software fork of Emby.
  626. #+BEGIN_SRC nix :noweb yes :tangle modules/jellyfin.nix
  627. # <<file-warning>>
  628. { config, pkgs, ... }:
  629. {
  630. services.jellyfin = {
  631. enable = true;
  632. };
  633. }
  634. #+END_SRC
  635. ** Moonlight
  636. #+NAME: module-moonlight
  637. #+BEGIN_SRC nix
  638. ./modules/moonlight.nix
  639. #+END_SRC
  640. Moonlight[fn:29] is an open-source implementation of NVIDIA's GameStream Protocol. You can stream your collection of PC games from your GameStream-compatible PC to any supported device and play them remotely. Moonlight[fn:29] is perfect for gaming on the go (or on GNU/Linux[fn:1]) without sacrificing the graphics and game selection available for the PC.
  641. #+BEGIN_SRC nix :noweb yes :tangle modules/moonlight.nix
  642. # <<file-warning>>
  643. { pkgs, ... }:
  644. {
  645. environment.systemPackages = [
  646. pkgs.moonlight-qt
  647. ];
  648. }
  649. #+END_SRC
  650. ** Teamviewer
  651. #+NAME: module-teamviewer
  652. #+BEGIN_SRC nix
  653. ./modules/teamviewer.nix
  654. #+END_SRC
  655. The Teamviewer[fn:30] remote connectivity cloud platform enables secure remote access to any device, across platforms, from anywhere, anytime. Teamviewer[fn:30] connects computers, smartphones, servers, IoT devices, robots -- anything -- with fast, high performance connections through their global access network. It has been used in outer-space low-bandwidth environments.
  656. #+BEGIN_SRC nix :noweb yes :tangle modules/teamviewer.nix
  657. # <<file-warning>>
  658. { pkgs, ... }:
  659. {
  660. # NOTE: Neither of these are working!
  661. # services.teamviewer.enable = true;
  662. # environment.systemPackages = [
  663. # pkgs.teamviewer
  664. # ];
  665. }
  666. #+END_SRC
  667. ** Home Manager
  668. Home Manager[fn:7] includes a =flake.nix= file for compatibility with Nix Flakes, a feature utilized heavily in this project. When using flakes, switching to a new configuration is done /only/ for the entire system, using the command ~nixos-rebuild switch --flake <path>~, instead of ~nixos-rebuild~, and ~home-manager~ seperately.
  669. #+NAME: module-home-manager
  670. #+BEGIN_SRC nix :noweb yes
  671. inputs.home-manager.nixosModules.home-manager {
  672. home-manager.useGlobalPkgs = true;
  673. home-manager.useUserPackages = true;
  674. home-manager.users.chris = {
  675. imports = [
  676. <<module-git>>
  677. <<module-gpg>>
  678. <<module-vim>>
  679. <<module-gtk>>
  680. <<module-emacs>>
  681. ];
  682. };
  683. }
  684. #+END_SRC
  685. *** Git
  686. #+NAME: module-git
  687. #+BEGIN_SRC nix
  688. ./modules/git.nix
  689. #+END_SRC
  690. Git[fn:31] is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn, has a tiny footprint, and lighting fast performance. It outclasses every other version control tool such as: SCM, Subversion, CVS, ClearCase, with features like cheap local branching, convinient staging areas, and multiple workflows.
  691. #+BEGIN_SRC nix :noweb yes :tangle modules/git.nix
  692. # <<file-warning>>
  693. { pkgs, ... }:
  694. {
  695. programs.git = {
  696. enable = true;
  697. userName = "Christopher James Hayward";
  698. userEmail = "chris@chrishayward.xyz";
  699. signing = {
  700. key = "37AB1CB72B741E478CA026D43025DCBD46F81C0F";
  701. signByDefault = true;
  702. };
  703. };
  704. }
  705. #+END_SRC
  706. *** Gpg
  707. #+NAME: module-gpg
  708. #+BEGIN_SRC nix
  709. ./modules/gpg.nix
  710. #+END_SRC
  711. GNU Privacy Guard[fn:32] is a free-software replacement for Symantec's PGP cryptographic software suite. It is compliant with RFC 4880, the IETF standards-track specification of OpenPGP. Modern versions of PGP are interoperable with GnuPG and other OpenPGP-compliant systems.
  712. #+BEGIN_SRC nix :noweb yes :tangle modules/gpg.nix
  713. # <<file-warning>>
  714. { pkgs, ... }:
  715. {
  716. services.gpg-agent = {
  717. enable = true;
  718. defaultCacheTtl = 1800;
  719. enableSshSupport = true;
  720. pinentryFlavor = "gtk2";
  721. };
  722. }
  723. #+END_SRC
  724. *** Vim
  725. #+NAME: module-vim
  726. #+BEGIN_SRC nix
  727. ./modules/vim.nix
  728. #+END_SRC
  729. Neovim[fn:33] is a project that seeks to aggressively refactor Vim in order to:
  730. + Simplify maintenance and encourage contributions
  731. + Split the work between multiple developers
  732. + Enable advanced UIs without core modification
  733. + Maximize extensibility
  734. #+BEGIN_SRC nix :noweb yes :tangle modules/vim.nix
  735. # <<file-warning>>
  736. { pkgs, ... }:
  737. {
  738. programs.neovim = {
  739. enable = true;
  740. viAlias = true;
  741. vimAlias = true;
  742. vimdiffAlias = true;
  743. extraConfig = ''
  744. set number relativenumber
  745. set nobackup
  746. '';
  747. extraPackages = [
  748. pkgs.nixfmt
  749. ];
  750. plugins = with pkgs.vimPlugins; [
  751. vim-nix
  752. vim-airline
  753. vim-polyglot
  754. ];
  755. };
  756. }
  757. #+END_SRC
  758. *** GTK
  759. #+NAME: module-gtk
  760. #+BEGIN_SRC nix
  761. ./modules/gtk.nix
  762. #+END_SRC
  763. GTK[fn:34] is a free and open-source, cross-platform widget toolkit for graphical user interfaces. It's one of the most popular toolkits for the Wayland[fn:24] and X11[fn:23] windowing systems.
  764. #+BEGIN_SRC nix :noweb yes :tangle modules/gtk.nix
  765. # <<file-warning>>
  766. { pkgs, ... }:
  767. {
  768. home.packages = [
  769. pkgs.arc-theme
  770. pkgs.arc-icon-theme
  771. pkgs.lxappearance
  772. ];
  773. home.file.".gtkrc-2.0" = {
  774. text = ''
  775. gtk-theme-name="Arc-Dark"
  776. gtk-icon-theme-name="Arc"
  777. gtk-font-name="Sans 10"
  778. gtk-cursor-theme-size=0
  779. gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
  780. gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
  781. gtk-button-images=0
  782. gtk-menu-images=0
  783. gtk-enable-event-sounds=1
  784. gtk-enable-input-feedback-sounds=1
  785. gtk-xft-antialias=1
  786. gtk-xft-hinting=1
  787. gtk-xft-hintstyle="hintmedium"
  788. '';
  789. };
  790. }
  791. #+END_SRC
  792. * Emacs Configuration
  793. #+NAME: module-emacs
  794. #+BEGIN_SRC nix
  795. ./modules/emacs.nix
  796. #+END_SRC
  797. GNU/Emacs[fn:2] is an extensible, customizable, free/libre text editor -- and more. At its core is an interpreter for Emacs Lisp[fn:32], a dialect of the Lisp programming language with extensions to support text editing. Other features include:
  798. + Highly customizable
  799. + Full Unicopde support
  800. + Content-aware editing modes
  801. + Complete built-in documentation
  802. + Wide range of functionality beyond text editing
  803. #+BEGIN_SRC nix :noweb yes :tangle modules/emacs.nix
  804. # <<file-warning>>
  805. { pkgs, ... }:
  806. let
  807. myEmacs = pkgs.emacsWithPackagesFromUsePackage {
  808. config = ../README.org;
  809. package = <<emacs-native-comp-package>>
  810. alwaysEnsure = true;
  811. alwaysTangle = true;
  812. extraEmacsPackages = epkgs: [
  813. # Required packages...
  814. <<emacs-exwm-package>>
  815. <<emacs-evil-package>>
  816. <<emacs-general-package>>
  817. <<emacs-which-key-package>>
  818. # Optional packages.
  819. <<emacs-org-package>>
  820. <<emacs-org-roam-package>>
  821. <<emacs-org-drill-package>>
  822. <<emacs-pomodoro-package>>
  823. <<emacs-writegood-package>>
  824. <<emacs-hugo-package>>
  825. <<emacs-reveal-package>>
  826. <<emacs-pass-package>>
  827. <<emacs-mu4e-package>>
  828. <<emacs-dired-package>>
  829. <<emacs-icons-package>>
  830. <<emacs-emoji-package>>
  831. <<emacs-eshell-package>>
  832. <<emacs-vterm-package>>
  833. <<emacs-magit-package>>
  834. <<emacs-fonts-package>>
  835. <<emacs-elfeed-package>>
  836. <<emacs-nix-mode-package>>
  837. <<emacs-projectile-package>>
  838. <<emacs-lsp-package>>
  839. <<emacs-company-package>>
  840. <<emacs-golang-package>>
  841. <<emacs-python-package>>
  842. <<emacs-plantuml-package>>
  843. <<emacs-swiper-package>>
  844. <<emacs-doom-themes-package>>
  845. <<emacs-doom-modeline-package>>
  846. ];
  847. };
  848. in {
  849. home.packages = [
  850. <<emacs-exwm-extras>>
  851. <<emacs-hugo-extras>>
  852. <<emacs-pass-extras>>
  853. <<emacs-mu4e-extras>>
  854. <<emacs-aspell-extras>>
  855. <<emacs-plantuml-extras>>
  856. <<emacs-nix-mode-extras>>
  857. ];
  858. programs.emacs = {
  859. enable = true;
  860. package = myEmacs;
  861. };
  862. <<emacs-exwm-config>>
  863. <<emacs-exwm-xinitrc>>
  864. <<emacs-mu4e-config>>
  865. }
  866. #+END_SRC
  867. When Emacs is started, it normally tries to load a Lisp program from an ititialization file, or /init/ file. This file, if it exists, specifies how to initialize and configure Emacs.
  868. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/init.el
  869. ;; <<file-warning>>
  870. ;; Required inputs.
  871. <<emacs-exwm-elisp>>
  872. <<emacs-evil-elisp>>
  873. <<emacs-general-elisp>>
  874. <<emacs-which-key-elisp>>
  875. ;; Optional inputs.
  876. <<emacs-org-elisp>>
  877. <<emacs-org-roam-elisp>>
  878. <<emacs-org-drill-elisp>>
  879. <<emacs-org-agenda-elisp>>
  880. <<emacs-pomodoro-elisp>>
  881. <<emacs-writegood-elisp>>
  882. <<emacs-aspell-elisp>>
  883. <<emacs-eww-elisp>>
  884. <<emacs-hugo-elisp>>
  885. <<emacs-reveal-elisp>>
  886. <<emacs-pass-elisp>>
  887. <<emacs-mu4e-elisp>>
  888. <<emacs-dired-elisp>>
  889. <<emacs-icons-elisp>>
  890. <<emacs-emoji-elisp>>
  891. <<emacs-eshell-elisp>>
  892. <<emacs-vterm-elisp>>
  893. <<emacs-magit-elisp>>
  894. <<emacs-fonts-elisp>>
  895. <<emacs-elfeed-elisp>>
  896. <<emacs-projectile-elisp>>
  897. <<emacs-lsp-elisp>>
  898. <<emacs-company-elisp>>
  899. <<emacs-golang-elisp>>
  900. <<emacs-python-elisp>>
  901. <<emacs-plantuml-elisp>>
  902. ;; User interface.
  903. <<emacs-swiper-elisp>>
  904. <<emacs-transparency-elisp>>
  905. <<emacs-doom-themes-elisp>>
  906. <<emacs-doom-modeline-elisp>>
  907. #+END_SRC
  908. It's somtimes desirable to have customization that takes effect during Emacs startup earlier than the normal init file. Place these configurations in =~/.emacs.d/early-init.el=. Most customizations should be put in the normal init file =~/.emacs.d/init.el=.
  909. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/early-init.el
  910. ;; <<file-warning>>
  911. <<emacs-disable-ui-elisp>>
  912. <<emacs-native-comp-elisp>>
  913. <<emacs-backup-files-elisp>>
  914. <<emacs-shell-commands-elisp>>
  915. #+END_SRC
  916. ** Disable UI
  917. Emacs[fn:2] has been around since the 1980s, and it's painfully obvious when you're greeted with the default user interface. Disable some unwanted features to clean it up, and bring the appearance to something closer to a modern editor.
  918. #+NAME: emacs-disable-ui-elisp
  919. #+BEGIN_SRC emacs-lisp
  920. ;; Disable unwanted UI elements.
  921. (tooltip-mode -1)
  922. (menu-bar-mode -1)
  923. (tool-bar-mode -1)
  924. (scroll-bar-mode -1)
  925. ;; Fix the scrolling behaviour.
  926. (setq scroll-conservatively 101)
  927. ;; Fix mouse-wheel scrolling behaviour.
  928. (setq mouse-wheel-follow-mouse t
  929. mouse-wheel-progressive-speed t
  930. mouse-wheel-scroll-amount '(3 ((shift) . 3)))
  931. #+END_SRC
  932. ** Native Comp
  933. #+NAME: emacs-native-comp-package
  934. #+BEGIN_SRC nix
  935. pkgs.emacsGcc;
  936. #+END_SRC
  937. Native Comp, also known as GccEmacs, refers to the ~--with-native-compilation~ configuration option when building GNU/Emacs[fn:2]. It adds support for compiling Emacs Lisp to native code using ~libgccjit~. All of the Emacs Lisp packages shipped with Emacs are native-compiled, providing a noticable performance iomprovement out-of-the-box.
  938. #+NAME: emacs-native-comp-elisp
  939. #+BEGIN_SRC emacs-lisp
  940. ;; Silence warnings from packages that don't support `native-comp'.
  941. (setq comp-async-report-warnings-errors nil ;; Emacs 27.2 ...
  942. native-comp-async-report-warnings-errors nil) ;; Emacs 28+ ...
  943. #+END_SRC
  944. ** Backup Files
  945. Emacs[fn:2] makes a backup for a file only the first time the file is saved from a buffer. No matter how many times the file is subsequently written to, the backup remains unchanged. For files managed by a version control system, backup files are redundant since the previous versions are already stored.
  946. #+NAME: emacs-backup-files-elisp
  947. #+BEGIN_SRC emacs-lisp
  948. ;; Disable unwanted features.
  949. (setq make-backup-files nil
  950. create-lockfiles nil)
  951. #+END_SRC
  952. ** Shell Commands
  953. Define some methods for interaction between GNU/Emacs[fn:2], and the systems underyling shell:
  954. 1) Method to run an external process, launching any application on a new process without interferring with Emacs[fn:2]
  955. 2) Method to apply commands to the curren call process, effecting the running instance of Emacs[fn:2]
  956. #+NAME: emacs-shell-commands-elisp
  957. #+BEGIN_SRC emacs-lisp
  958. ;; Define a method to run an external process.
  959. (defun dotfiles/run (cmd)
  960. "Run an external process."
  961. (interactive (list (read-shell-command "λ ")))
  962. (start-process-shell-command cmd nil cmd))
  963. ;; Define a method to run a background process.
  964. (defun dotfiles/run-in-background (cmd)
  965. (let ((command-parts (split-string cmd "[ ]+")))
  966. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  967. #+END_SRC
  968. ** Nix Mode
  969. #+NAME: emacs-nix-mode-extras
  970. #+BEGIN_SRC nix
  971. pkgs.nixfmt
  972. #+END_SRC
  973. Nix-mode[fn:35] is an Emacs[fn:2] major mode for editing Nix[fn:5] expressions. This provides basic handling of =.nix= files. Syntax highlighting and indentation support using =SMIE= are provided.
  974. #+NAME: emacs-nix-mode-package
  975. #+BEGIN_SRC nix
  976. epkgs.nix-mode
  977. #+END_SRC
  978. ** Evil Mode
  979. Evil[fn:13] is an extensible VI layer for GNU/Emacs[fn:2]. It emulates the main features of Vim[fn:33], turning GNU/Emacs[fn:2] into a modal editor.
  980. #+NAME: emacs-evil-package
  981. #+BEGIN_SRC nix
  982. epkgs.evil
  983. epkgs.evil-collection
  984. epkgs.evil-surround
  985. epkgs.evil-nerd-commenter
  986. #+END_SRC
  987. The next time Emacs[fn:2] is started, it will come up in /normal state/, denoted by =<N>= in the modeline. This is where the main ~vi~ bindings are defined. Like Emacs[fn:2] in general, Evil[fn:13] is extensible in Emacs Lisp[fn:32].
  988. #+NAME: emacs-evil-elisp
  989. #+BEGIN_SRC emacs-lisp
  990. ;; Enable the Extensible VI Layer for Emacs.
  991. (setq evil-want-integration t ;; Required for `evil-collection.'
  992. evil-want-keybinding nil) ;; Same as above.
  993. (evil-mode +1)
  994. ;; Configure `evil-collection'.
  995. (evil-collection-init)
  996. ;; Configure `evil-surround'.
  997. (global-evil-surround-mode +1)
  998. ;; Configure `evil-nerd-commenter'.
  999. (global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
  1000. #+END_SRC
  1001. ** EXWM
  1002. #+NAME: emacs-exwm-package
  1003. #+BEGIN_SRC nix
  1004. epkgs.exwm
  1005. #+END_SRC
  1006. EXWM (Emacs X Window Manager)[fn:12] is a full-featured tiling X window manager for GNU/Emacs[fn:2] built on-top of XELB. It features:
  1007. + Fully keyboard-driven operations
  1008. + Hybrid layout modes (tiling & stacking)
  1009. + Dynamic workspace support
  1010. + ICCM/EWMH compliance
  1011. #+NAME: emacs-exwm-extras
  1012. #+BEGIN_SRC nix
  1013. pkgs.nitrogen
  1014. pkgs.autorandr
  1015. #+END_SRC
  1016. I wanted to leave ~(exwm-enable)~ out of my Emacs configuration (which does no harm anyways). This can be called when using the daemon to start EXWM[fn:12].
  1017. #+NAME: emacs-exwm-config
  1018. #+BEGIN_SRC nix
  1019. xsession = {
  1020. enable = true;
  1021. windowManager.command = ''
  1022. ${pkgs.nitrogen}/bin/nitrogen --restore
  1023. ${myEmacs}/bin/emacs --daemon -f exwm-enable
  1024. ${myEmacs}/bin/emacsclient -c
  1025. '';
  1026. };
  1027. #+END_SRC
  1028. EXWM[fn:12] cannot make an X window manager by itself, this is by design; You must tell X to do it. Override the =~/.xinitrc= file to start the =xsession=.
  1029. #+NAME: emacs-exwm-xinitrc
  1030. #+BEGIN_SRC nix
  1031. home.file.".xinitrc" = {
  1032. text = ''
  1033. exec ./.xsession
  1034. '';
  1035. };
  1036. #+END_SRC
  1037. #+NAME: emacs-exwm-elisp
  1038. #+BEGIN_SRC emacs-lisp
  1039. ;; Configure `exwm'.
  1040. (setq exwm-worspace-show-all-buffers t)
  1041. (setq exwm-input-prefix-keys
  1042. '(?\M-x
  1043. ?\C-g
  1044. ?\C-\ ))
  1045. (setq exwm-input-global-keys
  1046. `(([?\s-r] . exwm-reset)
  1047. ,@(mapcar (lambda (i)
  1048. `(,(kbd (format "s-%d" i)) .
  1049. (lambda ()
  1050. (interactive)
  1051. (exwm-workspace-switch-create ,i))))
  1052. (number-sequence 1 9))))
  1053. ;; Configure `exwm-randr'.
  1054. (require 'exwm-randr)
  1055. (exwm-randr-enable)
  1056. ;; Configure custom hooks.
  1057. (setq display-time-and-date t)
  1058. (add-hook 'exwm-init-hook
  1059. (lambda ()
  1060. (display-battery-mode +1) ;; Display battery info (if available).
  1061. (display-time-mode +1))) ;; Display the time in the modeline.
  1062. ;; Setup buffer display names.
  1063. (add-hook 'exwm-update-class-hook
  1064. (lambda ()
  1065. (exwm-workspace-rename-buffer exwm-class-name))) ;; Use the system class name.
  1066. ;; Configure monitor hot-swapping.
  1067. (add-hook 'exwm-randr-screen-change-hook
  1068. (lambda ()
  1069. (dotfiles/run-in-background "autorandr --change --force"))) ;; Swap to the next screen config.
  1070. #+END_SRC
  1071. ** General
  1072. #+NAME: emacs-general-package
  1073. #+BEGIN_SRC nix
  1074. epkgs.general
  1075. #+END_SRC
  1076. General[fn:36] provides a more convenient method for binding keys in Emacs[fn:2], providing a unified interface for key definitions. Its primary purpose is to build on /existing/ functionality to make key definitions more clear and concise.
  1077. #+NAME: emacs-general-elisp
  1078. #+BEGIN_SRC emacs-lisp
  1079. ;; Use <SPC> as a leader key via `general.el'.
  1080. (general-create-definer dotfiles/leader
  1081. :states '(normal motion)
  1082. :keymaps 'override
  1083. :prefix "SPC"
  1084. :global-prefix "C-SPC")
  1085. ;; Find files with <SPC> <period> ...
  1086. ;; Switch buffers with <SPC> <comma> ...
  1087. (dotfiles/leader
  1088. "." '(find-file :which-key "File")
  1089. "," '(switch-to-buffer :which-key "Buffer")
  1090. "c" '(kill-buffer-and-window :which-key "Close"))
  1091. ;; Add keybindings for executing shell commands.
  1092. (dotfiles/leader
  1093. "r" '(:ignore t :which-key "Run")
  1094. "rr" '(dotfiles/run :which-key "Run")
  1095. "ra" '(async-shell-command :which-key "Async"))
  1096. ;; Add keybindings for quitting Emacs.
  1097. (dotfiles/leader
  1098. "q" '(:ignore t :which-key "Quit")
  1099. "qq" '(save-buffers-kill-emacs :which-key "Save")
  1100. "qw" '(kill-emacs :which-key "Now")
  1101. "qf" '(delete-frame :which-key "Frame"))
  1102. ;; Add keybindings for toggles / tweaks.
  1103. (dotfiles/leader
  1104. "t" '(:ignore t :which-key "Toggle / Tweak"))
  1105. ;; Add keybindings for working with frames to replace
  1106. ;; the C-x <num> <num> method of bindings, which is awful.
  1107. (dotfiles/leader
  1108. "w" '(:ignore t :which-key "Windows")
  1109. "ww" '(window-swap-states :which-key "Swap")
  1110. "wc" '(delete-window :which-key "Close")
  1111. "wh" '(windmove-left :which-key "Left")
  1112. "wj" '(windmove-down :which-key "Down")
  1113. "wk" '(windmove-up :which-key "Up")
  1114. "wl" '(windmove-right :which-key "Right")
  1115. "ws" '(:ignore t :which-key "Split")
  1116. "wsj" '(split-window-below :which-key "Below")
  1117. "wsl" '(split-window-right :which-key "Right"))
  1118. #+END_SRC
  1119. ** Which Key
  1120. Which-key[fn:37] is a minor mode for Emacs[fn:2] that displays the key bindings following your currently entered incomplete command (prefix) in a popup or mini-buffer.
  1121. #+NAME: emacs-which-key-package
  1122. #+BEGIN_SRC nix
  1123. epkgs.which-key
  1124. #+END_SRC
  1125. #+NAME: emacs-which-key-elisp
  1126. #+BEGIN_SRC emacs-lisp
  1127. ;; Configure `which-key' to see keyboard bindings in the
  1128. ;; mini-buffer and when using M-x.
  1129. (setq which-key-idle-delay 0.0)
  1130. (which-key-mode +1)
  1131. #+END_SRC
  1132. ** EWW
  1133. The Emacs Web Wowser[fn:38] is a Web browser written in Emacs Lisp[fn:32] based on the ~shr.el~ library. It's my primary browser when it comes to text-based browsing.
  1134. + Use ~eww~ as the default browser
  1135. + Don't use any special fonts or colours
  1136. #+NAME: emacs-eww-elisp
  1137. #+BEGIN_SRC emacs-lisp
  1138. ;; Set `eww' as the default browser.
  1139. (setq browse-url-browser-function 'eww-browse-url)
  1140. ;; Configure the `shr' rendering engine.
  1141. (setq shr-use-fonts nil
  1142. shr-use-colors nil)
  1143. #+END_SRC
  1144. ** Dired
  1145. #+NAME: emacs-dired-package
  1146. #+BEGIN_SRC nix
  1147. epkgs.dired-single
  1148. #+END_SRC
  1149. Dired[fn:39] shows a directory listing inside of an Emacs[fn:2] buffer that can be used to perform various file operations on files and subdirectories. THe operations you can perform are numerous, from creating subdirectories, byte-compiling files, searching, and editing files. Dired-Extra[fn:40] provides extra functionality for Dired[fn:39].
  1150. #+NAME: emacs-dired-elisp
  1151. #+BEGIN_SRC emacs-lisp
  1152. ;; Include `dired-x' for the `jump' method.
  1153. (require 'dired-x)
  1154. ;; Configure `dired-single' to support `evil' keys.
  1155. (evil-collection-define-key 'normal 'dired-mode-map
  1156. "h" 'dired-single-up-directory
  1157. "l" 'dired-single-buffer)
  1158. ;; Setup `all-the-icons' and the `dired' extension.
  1159. ;; Configure keybindings for `dired'.
  1160. (dotfiles/leader
  1161. "d" '(dired-jump :which-key "Dired"))
  1162. #+END_SRC
  1163. ** Icons
  1164. #+NAME: emacs-icons-package
  1165. #+BEGIN_SRC nix
  1166. epkgs.all-the-icons
  1167. epkgs.all-the-icons-dired
  1168. #+END_SRC
  1169. All The Icons[fn:41] is a utility package to collect various Icon Fonts and prioritize them within GNU/Emacs[fn:2].
  1170. #+NAME: emacs-icons-elisp
  1171. #+BEGIN_SRC emacs-lisp
  1172. ;; Setup `all-the-icons-dired'.
  1173. (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
  1174. ;; Display default font ligatures.
  1175. (global-prettify-symbols-mode +1)
  1176. #+END_SRC
  1177. ** Emojis
  1178. #+NAME: emacs-emoji-package
  1179. #+BEGIN_SRC nix
  1180. epkgs.emojify
  1181. #+END_SRC
  1182. Emojify[fn:42] is an Emacs[fn:2] extension to display Emojis. It can display GitHub style Emojis like :smile: or plain ascii ones such as :). It tries to be as efficient as possible, while also providing flexibility.
  1183. #+NAME: emacs-emoji-elisp
  1184. #+BEGIN_SRC emacs-lisp
  1185. ;; Setup `emojify'.
  1186. (add-hook 'after-init-hook 'global-emojify-mode)
  1187. #+END_SRC
  1188. ** EShell
  1189. #+NAME: emacs-eshell-package
  1190. #+BEGIN_SRC nix
  1191. epkgs.eshell-prompt-extras
  1192. #+END_SRC
  1193. EShell [fn:43] is a shell-like command interpreter for GNU/Emacs[fn:2] implemented in Emacs Lisp[fn:32]. It invokes no external processes except for those requested by the user. It's intended to be an alternative for IELM, and a full REPL envionment for Emacs[fn:2].
  1194. #+NAME: emacs-eshell-elisp
  1195. #+BEGIN_SRC emacs-lisp
  1196. ;; Configure `eshell'.
  1197. (setq eshell-highlight-prompt nil
  1198. eshell-prefer-lisp-functions nil)
  1199. ;; Configure the lambda prompt.
  1200. (autoload 'epe-theme-lambda "eshell-prompt-extras")
  1201. (setq eshell-prompt-function 'epe-theme-lambda)
  1202. ;; Configure keybindings for `eshell'.
  1203. (dotfiles/leader
  1204. "e" '(eshell :which-key "EShell"))
  1205. #+END_SRC
  1206. ** VTerm
  1207. Emacs Libvterm (VTerm)[fn:44] is a fully-fledged terminal emulator inside GNU/Emacs[fn:2] based on Libvterm[fn:45], a blazing fast C library used in Neovim[fn:33]. As a result of using compiled code (instead of Emacs Lisp[fn:32]), VTerm[fn:44] is capable, fast, and it can seamlessly handle large outputs.
  1208. #+NAME: emacs-vterm-package
  1209. #+BEGIN_SRC nix
  1210. epkgs.vterm
  1211. #+END_SRC
  1212. #+NAME: emacs-vterm-elisp
  1213. #+BEGIN_SRC emacs-lisp
  1214. ;; Add keybindings for interacting with the shell(s).
  1215. (dotfiles/leader
  1216. "v" '(vterm :which-key "VTerm"))
  1217. #+END_SRC
  1218. ** Magit
  1219. Magit[fn:46] is an interface to the Git[fn:31] version control system, implemented as a GNU/Emacs[fn:2] package written in Elisp[fn:32]. It fills the glaring gap between the Git[fn:31] command line interface and various GUIs, letting you perform trivial as well as elaborate version control tasks within a few mnemonic key presses.
  1220. #+NAME: emacs-magit-package
  1221. #+BEGIN_SRC nix
  1222. epkgs.magit
  1223. #+END_SRC
  1224. | Key | Description |
  1225. |-----+--------------------------------------|
  1226. | gg | Check the status of a repository |
  1227. | gc | Clone a remote repository |
  1228. | gf | Fetch the contents of the repository |
  1229. | gp | Pull the remotes of the repository |
  1230. #+NAME: emacs-magit-elisp
  1231. #+BEGIN_SRC emacs-lisp
  1232. ;; Add keybindings for working with `magit'.
  1233. (dotfiles/leader
  1234. "g" '(:ignore t :which-key "Git")
  1235. "gg" '(magit-status :which-key "Status")
  1236. "gc" '(magit-clone :which-key "Clone")
  1237. "gf" '(magit-fetch :which-key "Fetch")
  1238. "gp" '(magit-pull :which-key "Pull"))
  1239. #+END_SRC
  1240. ** Fonts
  1241. #+NAME: emacs-fonts-package
  1242. #+BEGIN_SRC nix
  1243. epkgs.hydra
  1244. #+END_SRC
  1245. #+NAME: emacs-fonts-elisp
  1246. #+BEGIN_SRC emacs-lisp
  1247. ;; Configure the font when running as `emacs-server'.
  1248. (custom-set-faces
  1249. '(default ((t (:inherit nil :height 96 :family "Iosevka")))))
  1250. ;; Set all three of Emacs' font faces.
  1251. ;; NOTE: This only works without `emacs-server'.
  1252. ;; (set-face-attribute 'default nil :font "Iosevka" :height 96)
  1253. ;; (set-face-attribute 'fixed-pitch nil :font "Iosevka" :height 96)
  1254. ;; (set-face-attribute 'variable-pitch nil :font "Iosevka" :height 96)
  1255. ;; Define a `hydra' function for scaling the text interactively.
  1256. (defhydra hydra-text-scale (:timeout 4)
  1257. "Scale text"
  1258. ("j" text-scale-decrease "Decrease")
  1259. ("k" text-scale-increase "Increase")
  1260. ("f" nil "Finished" :exit t))
  1261. ;; Create keybinding for calling the function.
  1262. (dotfiles/leader
  1263. "tf" '(hydra-text-scale/body :which-key "Font"))
  1264. #+END_SRC
  1265. ** Elfeed
  1266. #+NAME: emacs-elfeed-package
  1267. #+BEGIN_SRC nix
  1268. epkgs.elfeed
  1269. #+END_SRC
  1270. Elfeed[fn:47] is an extensible web feed reader for GNU/Emacs[fn:2], support both =Atom= and =RSS=. It requires =Emacs 24.3+= and is available for download from the standard repositories.
  1271. | Key | Command |
  1272. |-----+---------|
  1273. | l | Open |
  1274. | u | Update |
  1275. #+NAME: emacs-elfeed-elisp
  1276. #+BEGIN_SRC emacs-lisp
  1277. ;; Add custom feeds for `elfeed' to fetch.
  1278. (setq elfeed-feeds (quote
  1279. (("https://hexdsl.co.uk/rss.xml")
  1280. ("https://lukesmith.xyz/rss.xml")
  1281. ("https://friendo.monster/rss.xml")
  1282. ("https://chrishayward.xyz/index.xml")
  1283. ("https://protesilaos.com/codelog.xml"))))
  1284. ;; Add custom keybindings for `elfeed'.
  1285. (dotfiles/leader
  1286. "l" '(:ignore t :which-key "Elfeed")
  1287. "ll" '(elfeed :which-key "Open")
  1288. "lu" '(elfeed-update :which-key "Update"))
  1289. #+END_SRC
  1290. ** Org Mode
  1291. #+NAME: emacs-org-package
  1292. #+BEGIN_SRC nix
  1293. epkgs.org
  1294. #+END_SRC
  1295. Org-mode[fn:48] is a document editing and organizing mode, designed for notes, planning, and authoring within the free software text editor GNU/Emacs[fn:2]. The name is used to encompass plain text files (such as this one) that include simple marks to indicate levels of a hierarchy, and an editor with functions that can read the markup and manipulate the hierarchy elements.
  1296. #+NAME: emacs-org-elisp
  1297. #+BEGIN_SRC emacs-lisp
  1298. ;; Configure `org-mode' source blocks.
  1299. (setq org-src-fontify-natively t ;; Make source blocks prettier.
  1300. org-src-tab-acts-natively t ;; Use TAB indents within source blocks.
  1301. org-src-preserve-indentation t) ;; Stop `org-mode' from formatting blocks.
  1302. ;; Add an `org-mode-hook'.
  1303. (add-hook 'org-mode-hook
  1304. (lambda ()
  1305. (org-indent-mode)
  1306. (visual-line-mode)))
  1307. ;; Remove the `Validate XHTML 1.0' message from HTML export.
  1308. (setq org-export-html-validation-link nil
  1309. org-html-validation-link nil)
  1310. ;; TODO: Configure default structure templates.
  1311. ;; (require 'org-tempo)
  1312. ;; Apply custom keybindings.
  1313. (dotfiles/leader
  1314. "o" '(:ignore t :which-key "Org")
  1315. "oe" '(org-export-dispatch :which-key "Export")
  1316. "ot" '(org-babel-tangle :which-key "Tangle")
  1317. "oi" '(org-toggle-inline-images :which-key "Images")
  1318. "of" '(:ignore t :which-key "Footnotes")
  1319. "ofn" '(org-footnote-normalize :which-key "Normalize"))
  1320. #+END_SRC
  1321. ** Org Roam
  1322. #+NAME: emacs-org-roam-package
  1323. #+BEGIN_SRC nix
  1324. epkgs.org-roam
  1325. epkgs.org-roam-server
  1326. #+END_SRC
  1327. Org Roam[fn:49] is a plain-text knowledge management system. It borrows principles from the Zettelkasten method[fn:50], providing a solution for non-hierarchical note-taking. It should also work as a plug-and-play solution for anyone already using Org Mode[fn:48] for their personal wiki (me). Org Roam Server[fn:51] is a Web application to visualize the Org Roam[fn:49] database. Although it should automatically reload if there's a change in the database, it can be done so manually by clicking the =reload= button on the Web interface.
  1328. #+NAME: emacs-org-roam-elisp
  1329. #+BEGIN_SRC emacs-lisp
  1330. ;; Setup `org-roam' hooks.
  1331. (add-hook 'after-init-hook
  1332. (lambda ()
  1333. (org-roam-mode)
  1334. (org-roam-server-mode)))
  1335. ;; Configure `org-roam'.
  1336. (setq org-roam-encrypt-files t
  1337. org-roam-directory (expand-file-name "/etc/dotfiles")
  1338. org-roam-capture-templates '()
  1339. org-roam-dailies-capture-templates '())
  1340. ;; Encrypt files with the public key.
  1341. (setq epa-file-select-keys 2
  1342. epa-file-encrypt-to "37AB1CB72B741E478CA026D43025DCBD46F81C0F"
  1343. epa-cache-passphrase-for-symmetric-encryption t)
  1344. ;; Define a new `title-to-slug' function to override the default `org-roam-title-to-slug' function.
  1345. ;; This is done to change the replacement character from "_" to "-".
  1346. (require 'cl-lib)
  1347. (defun dotfiles/title-to-slug (title)
  1348. "Convert TITLE to a filename-suitable slug."
  1349. (cl-flet* ((nonspacing-mark-p (char)
  1350. (eq 'Mn (get-char-code-property char 'general-category)))
  1351. (strip-nonspacing-marks (s)
  1352. (apply #'string (seq-remove #'nonspacing-mark-p
  1353. (ucs-normalize-NFD-string s))))
  1354. (cl-replace (title pair)
  1355. (replace-regexp-in-string (car pair) (cdr pair) title)))
  1356. (let* ((pairs `(("[^[:alnum:][:digit:]]" . "-") ;; Convert anything not alphanumeric.
  1357. ("--*" . "-") ;; Remove sequential dashes.
  1358. ("^-" . "") ;; Remove starting dashes.
  1359. ("-$" . ""))) ;; Remove ending dashes.
  1360. (slug (-reduce-from #'cl-replace (strip-nonspacing-marks title) pairs)))
  1361. (downcase slug))))
  1362. (setq org-roam-title-to-slug-function #'dotfiles/title-to-slug)
  1363. ;; Configure capture templates.
  1364. ;; Standard document.
  1365. (add-to-list 'org-roam-capture-templates
  1366. '("d" "Default" entry (function org-roam-capture--get-point)
  1367. "%?"
  1368. :file-name "docs/${slug}"
  1369. :unnarrowed t
  1370. :head
  1371. "
  1372. ,#+TITLE: ${title}
  1373. ,#+AUTHOR: Christopher James Hayward
  1374. ,#+EMAIL: chris@chrishayward.xyz
  1375. "))
  1376. ;; Course document.
  1377. (add-to-list 'org-roam-capture-templates
  1378. '("c" "Course" plain (function org-roam-capture--get-point)
  1379. "%?"
  1380. :file-name "docs/courses/${slug}"
  1381. :unnarrowed t
  1382. :head
  1383. "
  1384. ,#+TITLE: ${title}
  1385. ,#+SUBTITLE:
  1386. ,#+AUTHOR: Christopher James Hayward
  1387. ,#+EMAIL: chris@chrishayward.xyz
  1388. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1389. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1390. "))
  1391. ;; Daily notes.
  1392. (add-to-list 'org-roam-dailies-capture-templates
  1393. '("d" "Default" entry (function org-roam-capture--get-point)
  1394. "* %?"
  1395. :file-name "docs/daily/%<%Y-%m-%d>"
  1396. :head
  1397. "
  1398. ,#+TITLE: %<%Y-%m-%d>
  1399. ,#+AUTHOR: Christopher James Hayward
  1400. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1401. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1402. "))
  1403. ;; Apply custom keybindings.
  1404. (dotfiles/leader
  1405. "or" '(:ignore t :which-key "Roam")
  1406. "ori" '(org-roam-insert :which-key "Insert")
  1407. "orf" '(org-roam-find-file :which-key "Find")
  1408. "orc" '(org-roam-capture :which-key "Capture")
  1409. "orb" '(org-roam-buffer-toggle-display :which-key "Buffer"))
  1410. ;; Apply custom keybindings for dailies.
  1411. (dotfiles/leader
  1412. "ord" '(:ignore t :which-key "Dailies")
  1413. "ordd" '(org-roam-dailies-find-date :which-key "Date")
  1414. "ordt" '(org-roam-dailies-find-today :which-key "Today")
  1415. "ordm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
  1416. "ordy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
  1417. #+END_SRC
  1418. ** Org Drill
  1419. #+NAME: emacs-org-drill-package
  1420. #+BEGIN_SRC nix
  1421. epkgs.org-drill
  1422. #+END_SRC
  1423. Org Drill[fn:52] is an extension for Org Mode[fn:48] that uses a spaced repition algorithm to conduct interactive /Drill Sessions/ using Org files as sources of facts to be memorized.
  1424. #+NAME: emacs-org-drill-elisp
  1425. #+BEGIN_SRC emacs-lisp
  1426. ;; Configure keybindings for `org-drill'.
  1427. (dotfiles/leader
  1428. "od" '(:ignore t :which-key "Drill")
  1429. "odd" '(org-drill :which-key "Drill")
  1430. "odc" '(org-drill-cram :which-key "Cram")
  1431. "odr" '(org-drill-resume :which-key "Resume"))
  1432. #+END_SRC
  1433. ** Org Agenda
  1434. The way Org Mode[fn:48] works, TODO items, time-stamped items, and tagged headlines can be scattered throughout a file, or even a number of files. To get an overview of open action items, or of events that are important for a particular date, this information must be collected, sorted, and displayed in an organized way.
  1435. #+NAME: emacs-org-agenda-elisp
  1436. #+BEGIN_SRC emacs-lisp
  1437. ;; Configure `org-agenda' to use the project files.
  1438. (setq org-agenda-files '("/etc/dotfiles/"
  1439. "/etc/dotfiles/docs/"
  1440. "/etc/dotfiles/docs/courses/"
  1441. "/etc/dotfiles/docs/daily/"
  1442. "/etc/dotfiles/docs/notes/"
  1443. "/etc/dotfiles/docs/posts/"
  1444. "/etc/dotfiles/docs/slides/"))
  1445. ;; Include files encrypted with `gpg'.
  1446. (require 'org)
  1447. (unless (string-match-p "\\.gpg" org-agenda-file-regexp)
  1448. (setq org-agenda-file-regexp
  1449. (replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?"
  1450. org-agenda-file-regexp)))
  1451. ;; Open an agenda buffer with SPC o a.
  1452. (dotfiles/leader
  1453. "oa" '(org-agenda :which-key "Agenda"))
  1454. #+END_SRC
  1455. ** Org Pomodoro
  1456. #+NAME: emacs-pomodoro-package
  1457. #+BEGIN_SRC nix
  1458. epkgs.org-pomodoro
  1459. #+END_SRC
  1460. Org Pomodoro[fn:53] adds basic support for the Pomodoro Technique[fn:54] in GNU/Emacs[fn:2]. It can be started for the task at point, or the last task time was clocked for. Each session starts a timer of 25 minutes, finishing with a break of 5 minutes. After 4 sessions, ther will be a break of 20 minutes. All values are customizable.
  1461. #+NAME: emacs-pomodoro-elisp
  1462. #+BEGIN_SRC emacs-lisp
  1463. ;; Configure `org-pomodor' with the overtime workflow.
  1464. (setq org-pomodoro-manual-break t
  1465. org-pomodoro-keep-killed-time t)
  1466. ;; Configure keybindings.
  1467. (dotfiles/leader
  1468. "op" '(org-pomodoro :which-key "Pomodoro"))
  1469. #+END_SRC
  1470. ** Writegood Mode
  1471. #+NAME: emacs-writegood-package
  1472. #+BEGIN_SRC nix
  1473. epkgs.writegood-mode
  1474. #+END_SRC
  1475. Writegood Mode[fn:55] is an Emacs[fn:2] minor mode to aid in finding common writing problems. It highlights the text based on the following criteria:
  1476. + Weasel Words
  1477. + Passive Voice
  1478. + Duplicate Words
  1479. #+NAME: emacs-writegood-elisp
  1480. #+BEGIN_SRC emacs-lisp
  1481. ;; Configure `writegood-mode'.
  1482. (dotfiles/leader
  1483. "tg" '(writegood-mode :which-key "Grammar"))
  1484. #+END_SRC
  1485. ** Aspell
  1486. #+NAME: emacs-aspell-extras
  1487. #+BEGIN_SRC nix
  1488. pkgs.aspell
  1489. pkgs.aspellDicts.en
  1490. pkgs.aspellDicts.en-science
  1491. pkgs.aspellDicts.en-computers
  1492. #+END_SRC
  1493. GNU Aspell[fn:56] is a Free and Open Source spell checker designed to replace ISpell. It can be used as a library, or an independent spell checker. Its main feature is that it does a superior job of suggesting possible replacements for mis-spelled words than any other spell checker for the English language.
  1494. #+NAME: emacs-aspell-elisp
  1495. #+BEGIN_SRC emacs-lisp
  1496. ;; Use `aspell' as a drop-in replacement for `ispell'.
  1497. (setq ispell-program-name "aspell"
  1498. ispell-eextra-args '("--sug-mode=fast"))
  1499. ;; Configure the built-in `flyspell-mode'.
  1500. (dotfiles/leader
  1501. "ts" '(flyspell-mode :which-key "Spelling"))
  1502. #+END_SRC
  1503. ** Hugo
  1504. #+NAME: emacs-hugo-extras
  1505. #+BEGIN_SRC nix
  1506. pkgs.hugo
  1507. #+END_SRC
  1508. Hugo[fn:57] is one of the most popular open-source static site generators.
  1509. #+NAME: emacs-hugo-package
  1510. #+BEGIN_SRC nix
  1511. epkgs.ox-hugo
  1512. #+END_SRC
  1513. Ox-Hugo[fn:58] is an Org-Mode[fn:48] exporter for Hugo[fn:57] compabile markdown. I post nonsense on my Personal Blog[fn:59], and share my notes on various textbooks, articles, and software Here[fn:60].
  1514. #+NAME: emacs-hugo-elisp
  1515. #+BEGIN_SRC emacs-lisp
  1516. ;; Configure `ox-hugo' as an `org-mode-export' backend.
  1517. (require 'ox-hugo)
  1518. ;; Capture templates.
  1519. ;; Personal blog post.
  1520. (add-to-list 'org-roam-capture-templates
  1521. '("p" "Post" plain (function org-roam-capture--get-point)
  1522. "%?"
  1523. :file-name "docs/posts/${slug}"
  1524. :unnarrowed t
  1525. :head
  1526. "
  1527. ,#+TITLE: ${title}
  1528. ,#+AUTHOR: Christopher James Hayward
  1529. ,#+DATE: %<%Y-%m-%d>
  1530. ,#+OPTIONS: num:nil todo:nil tasks:nil
  1531. ,#+EXPORT_FILE_NAME: ${slug}
  1532. ,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
  1533. ,#+HUGO_BASE_DIR: ../
  1534. ,#+HUGO_AUTO_SET_LASTMOD: t
  1535. ,#+HUGO_SECTION: posts
  1536. ,#+HUGO_DRAFT: true
  1537. "))
  1538. ;; Shared notes.
  1539. (add-to-list 'org-roam-capture-templates
  1540. '("n" "Notes" plain (function org-roam-capture--get-point)
  1541. "%?"
  1542. :file-name "docs/notes/${slug}"
  1543. :unnarrowed t
  1544. :head
  1545. "
  1546. ,#+TITLE: ${title}
  1547. ,#+AUTHOR: Christopher James Hayward
  1548. ,#+OPTIONS: num:nil todo:nil tasks:nil
  1549. ,#+EXPORT_FILE_NAME: ${slug}
  1550. ,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/
  1551. ,#+HUGO_BASE_DIR: ../
  1552. ,#+HUGO_AUTO_SET_LASTMOD: t
  1553. ,#+HUGO_SECTION: notes
  1554. ,#+HUGO_DRAFT: true
  1555. "))
  1556. #+END_SRC
  1557. ** Reveal
  1558. #+NAME: emacs-reveal-package
  1559. #+BEGIN_SRC nix
  1560. epkgs.ox-reveal
  1561. #+END_SRC
  1562. Reveal.js[fn:61] is an open source HTML presentation framework. It enables anyone with a web browser to create fully-featured and beautiful presentations for free. Presentations with Reveal.js[fn:61] are built on open web technologies. That means anything you can do on the web, you can do in your presentation. Ox Reveal[fn:62] is an Org Mode[fn:48] export backend.
  1563. #+NAME: emacs-reveal-elisp
  1564. #+BEGIN_SRC emacs-lisp
  1565. ;; Configure `ox-reveal' as an `org-mode-export' backend.
  1566. (require 'ox-reveal)
  1567. ;; Don't rely on any local software.
  1568. (setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js")
  1569. ;; Create a capture template.
  1570. (add-to-list 'org-roam-capture-templates
  1571. '("s" "Slides" plain (function org-roam-capture--get-point)
  1572. "%?"
  1573. :file-name "docs/slides/${slug}"
  1574. :unnarrowed t
  1575. :head
  1576. "
  1577. ,#+TITLE: ${title}
  1578. ,#+AUTHOR: Christopher James Hayward
  1579. ,#+EMAIL: chris@chrishayward.xyz
  1580. ,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
  1581. ,#+REVEAL_THEME: serif
  1582. ,#+EXPORT_FILE_NAME: ${slug}
  1583. ,#+OPTIONS: reveal_title_slide:nil
  1584. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1585. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1586. "))
  1587. #+END_SRC
  1588. ** Passwords
  1589. #+NAME: emacs-pass-extras
  1590. #+BEGIN_SRC nix
  1591. pkgs.pass
  1592. #+END_SRC
  1593. With Pass[fn:63], each password lives inside of an encrypted =gpg= file, whose name is the title of the website or resource that requires the password. These encrypted files may be organized into meaningful folder hierarchies, compies from computer to computer, and in general, manipulated using standard command line tools.
  1594. #+NAME: emacs-pass-package
  1595. #+BEGIN_SRC nix
  1596. epkgs.password-store
  1597. #+END_SRC
  1598. Configure keybindings for passwords behind =SPC p=:
  1599. | Key | Description |
  1600. |-----+---------------------|
  1601. | p | Copy a password |
  1602. | r | Rename a password |
  1603. | g | Generate a password |
  1604. #+NAME: emacs-pass-elisp
  1605. #+BEGIN_SRC emacs-lisp
  1606. ;; Set the path to the password store.
  1607. (setq password-store-dir (expand-file-name "~/.password-store"))
  1608. ;; Apply custom keybindings.
  1609. (dotfiles/leader
  1610. "p" '(:ignore t :which-key "Passwords")
  1611. "pp" '(password-store-copy :which-key "Copy")
  1612. "pr" '(password-store-rename :which-key "Rename")
  1613. "pg" '(password-store-generate :which-key "Generate"))
  1614. #+END_SRC
  1615. ** MU4E
  1616. #+NAME: emacs-mu4e-extras
  1617. #+BEGIN_SRC nix
  1618. pkgs.mu
  1619. pkgs.isync
  1620. #+END_SRC
  1621. #+NAME: emacs-mu4e-package
  1622. #+BEGIN_SRC nix
  1623. epkgs.mu4e-alert
  1624. #+END_SRC
  1625. #+NAME: emacs-mu4e-config
  1626. #+BEGIN_SRC nix
  1627. home.file.".mbsyncrc" = {
  1628. text = ''
  1629. IMAPStore xyz-remote
  1630. Host mail.chrishayward.xyz
  1631. User chris@chrishayward.xyz
  1632. PassCmd "pass chrishayward.xyz/chris"
  1633. SSLType IMAPS
  1634. MaildirStore xyz-local
  1635. Path ~/.cache/mail/
  1636. Inbox ~/.cache/mail/inbox
  1637. SubFolders Verbatim
  1638. Channel xyz
  1639. Far :xyz-remote:
  1640. Near :xyz-local:
  1641. Patterns * !Archives
  1642. Create Both
  1643. Expunge Both
  1644. SyncState *
  1645. '';
  1646. };
  1647. #+END_SRC
  1648. #+BEGIN_SRC sh
  1649. mbsync -a
  1650. mu init --maildir="~/.cache/mail" --my-address="chris@chrishayward.xyz"
  1651. mu index
  1652. #+END_SRC
  1653. #+NAME: emacs-mu4e-elisp
  1654. #+BEGIN_SRC emacs-lisp
  1655. ;; Add the `mu4e' shipped with `mu' to the load path.
  1656. (add-to-list 'load-path "/etc/profiles/per-user/chris/share/emacs/site-lisp/mu4e/")
  1657. (require 'mu4e)
  1658. ;; Confiugure `mu4e'.
  1659. (setq mu4e-maildir "~/.cache/mail"
  1660. mu4e-update-interval (* 5 60)
  1661. mu4e-get-mail-command "mbsync -a"
  1662. mu4e-compose-format-flowed t
  1663. mu4e-change-filenames-when-moving t
  1664. mu4e-compose-signature (concat "Chris Hayward\n"
  1665. "chris@chrishayward.xyz"))
  1666. ;; Sign all outbound email with GPG.
  1667. (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
  1668. (setq message-send-mail-function 'smtpmail-send-it
  1669. mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
  1670. ;; Setup `mu4e' accounts.
  1671. (setq mu4e-contexts
  1672. (list
  1673. ;; Main
  1674. ;; chris@chrishayward.xyz
  1675. (make-mu4e-context
  1676. :name "Main"
  1677. :match-func
  1678. (lambda (msg)
  1679. (when msg
  1680. (string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
  1681. :vars
  1682. '((user-full-name . "Christopher James Hayward")
  1683. (user-mail-address . "chris@chrishayward.xyz")
  1684. (smtpmail-smtp-server . "mail.chrishayward.xyz")
  1685. (smtpmail-smtp-service . 587)
  1686. (smtpmail-stream-type . starttls)))))
  1687. ;; Setup `mu4e-alert'.
  1688. (setq mu4e-alert-set-default-style 'libnotify)
  1689. (mu4e-alert-enable-notifications)
  1690. (mu4e-alert-enable-mode-line-display)
  1691. ;; Open the `mu4e' dashboard.
  1692. (dotfiles/leader
  1693. "m" '(mu4e :which-key "Mail"))
  1694. #+END_SRC
  1695. ** Projectile
  1696. #+NAME: emacs-projectile-package
  1697. #+BEGIN_SRC nix
  1698. epkgs.projectile
  1699. #+END_SRC
  1700. Projectile[fn:64] is a project interaction library for GNU/Emacs[fn:2]. Its goal is to provide a nice set of features operating on a project level, without introducing external dependencies.
  1701. #+NAME: emacs-projectile-elisp
  1702. #+BEGIN_SRC emacs-lisp
  1703. ;; Configure the `projectile-project-search-path'.
  1704. (setq projectile-project-search-path '("~/.local/source"))
  1705. (projectile-mode +1)
  1706. #+END_SRC
  1707. ** LSP Mode
  1708. #+NAME: emacs-lsp-package
  1709. #+BEGIN_SRC nix
  1710. epkgs.lsp-mode
  1711. epkgs.lsp-ui
  1712. #+END_SRC
  1713. The Language Server Protocol (LSP)[fn:65] defines the protocol used between an Editor or IDE, and a language server that provides features like:
  1714. + Auto Complete
  1715. + Go To Defintion
  1716. + Find All References
  1717. #+NAME: emacs-lsp-elisp
  1718. #+BEGIN_SRC emacs-lisp
  1719. ;; Configure `lsp-mode'.
  1720. (setq lsp-idle-delay 0.5
  1721. lsp-prefer-flymake t)
  1722. ;; Configure `lsp-ui'.
  1723. (setq lsp-ui-doc-position 'at-point
  1724. lsp-ui-doc-delay 0.5)
  1725. #+END_SRC
  1726. ** Company Mode
  1727. #+NAME: emacs-company-package
  1728. #+BEGIN_SRC nix
  1729. epkgs.company
  1730. #+END_SRC
  1731. Company[fn:66] is a text completion framework for GNU/Emacs[fn:2]. The name stands for =Complete Anything=. It uses pluggable back-ends and front-ends to retieve and display completion candidates.
  1732. #+NAME: emacs-company-elisp
  1733. #+BEGIN_SRC emacs-lisp
  1734. ;; Configure `company-mode'.
  1735. (setq company-backend 'company-capf
  1736. lsp-completion-provider :capf)
  1737. ;; Enable it globally.
  1738. (global-company-mode +1)
  1739. #+END_SRC
  1740. ** Go Mode
  1741. #+NAME: emacs-golang-package
  1742. #+BEGIN_SRC nix
  1743. epkgs.go-mode
  1744. #+END_SRC
  1745. Go Mode[fn:67] is a major mode for editing Golang[fn:18] source code in GNU/Emacs[fn:2].
  1746. #+NAME: emacs-golang-elisp
  1747. #+BEGIN_SRC emacs-lisp
  1748. ;; Configure `go-mode' to work with `lsp-mode'.
  1749. (defun dotfiles/go-hook ()
  1750. (add-hook 'before-save-hook #'lsp-format-buffer t t)
  1751. (add-hook 'before-save-hook #'lsp-organize-imports t t))
  1752. ;; Configure a custom `before-save-hook'.
  1753. (add-hook 'go-mode-hook #'dotfiles/go-hook)
  1754. #+END_SRC
  1755. ** Python Mode
  1756. #+NAME: emacs-python-package
  1757. #+BEGIN_SRC nix
  1758. epkgs.pretty-mode
  1759. #+END_SRC
  1760. The built in Python Mode[fn:68] has a nice feature set for working with Python[fn:22] code in GNU/Emacs[fn:2]. It is complimented with the addition of an LSP[fn:65] server. These tools are included in the Development Shell[fn:17] for Python[fn:22].
  1761. #+NAME: emacs-python-elisp
  1762. #+BEGIN_SRC emacs-lisp
  1763. ;; Configure `pretty-mode' to work with `python-mode'.
  1764. (add-hook 'python-mode-hook
  1765. (lambda ()
  1766. (turn-on-pretty-mode)))
  1767. #+END_SRC
  1768. ** PlantUML
  1769. #+NAME: emacs-plantuml-extras
  1770. #+BEGIN_SRC nix
  1771. pkgs.plantuml
  1772. #+END_SRC
  1773. PlantUML[fn:69] is an open-source tool allowing users to create diagrams from a plain-text language. Besides various UML diagrams, PlantUML[fn:69] has support for various other software developmented related formats, as well as visualizations of =JSON= and =YAML= files.
  1774. #+NAME: emacs-plantuml-package
  1775. #+BEGIN_SRC nix
  1776. epkgs.plantuml-mode
  1777. #+END_SRC
  1778. PlantUML Mode[fn:70] is a major mode for editing PlantUML[fn:69] sources in GNU/Emacs[fn:2].
  1779. #+NAME: emacs-plantuml-elisp
  1780. #+BEGIN_SRC emacs-lisp
  1781. ;; Configure `plantuml-mode'.
  1782. (setq plantuml-default-exec-mode 'executable)
  1783. #+END_SRC
  1784. ** Swiper
  1785. #+NAME: emacs-swiper-package
  1786. #+BEGIN_SRC nix
  1787. epkgs.ivy
  1788. epkgs.counsel
  1789. epkgs.ivy-rich
  1790. epkgs.ivy-posframe
  1791. epkgs.ivy-prescient
  1792. #+END_SRC
  1793. Ivy (Swiper)[fn:71] is a generic completion mechanism for GNU/Emacs[fn:2]. While operating similarily to other completion schemes like =icomplete-mode=, it aims to be more efficient, smaller, simpler, and smoother to use, while remaining highly customizable.
  1794. #+NAME: emacs-swiper-elisp
  1795. #+BEGIN_SRC emacs-lisp
  1796. ;; Configure `ivy'.
  1797. (setq counsel-linux-app-format-function
  1798. #'counsel-linux-app-format-function-name-only)
  1799. (ivy-mode +1)
  1800. (counsel-mode +1)
  1801. ;; Configure `ivy-rich'.
  1802. (ivy-rich-mode +1)
  1803. ;; Configure `ivy-posframe'.
  1804. (setq ivy-posframe-parameters '((parent-frame nil))
  1805. ivy-posframe-display-functions-alist '((t . ivy-posframe-display)))
  1806. (ivy-posframe-mode +1)
  1807. ;; Configure `ivy-prescient'.
  1808. (setq ivy-prescient-enable-filtering nil)
  1809. (ivy-prescient-mode +1)
  1810. #+END_SRC
  1811. ** Transparency
  1812. It's possible to control the frame opacity in GNU/Emacs[fn:2]. Unlike other transparency hacks, it's not merely showing the desktop background image, but is true transparency -- you can se other windows behind the Emacs[fn:2] window.
  1813. #+NAME: emacs-transparency-elisp
  1814. #+BEGIN_SRC emacs-lisp
  1815. ;; Configure the default frame transparency.
  1816. (set-frame-parameter (selected-frame) 'alpha '(95 . 95))
  1817. (add-to-list 'default-frame-alist '(alpha . (95 . 95)))
  1818. #+END_SRC
  1819. ** Doom Themes
  1820. #+NAME: emacs-doom-themes-package
  1821. #+BEGIN_SRC nix
  1822. epkgs.doom-themes
  1823. #+END_SRC
  1824. Doom Themes[fn:72] is a theme megapack for GNU/Emacs[fn:2], inspired by community favourites.
  1825. #+NAME: emacs-doom-themes-elisp
  1826. #+BEGIN_SRC emacs-lisp
  1827. ;; Include modern themes from `doom-themes'.
  1828. (setq doom-themes-enable-bold t
  1829. doom-themes-enable-italic t)
  1830. ;; Load the `doom-moonlight' theme.
  1831. (load-theme 'doom-moonlight t)
  1832. (doom-modeline-mode +1)
  1833. ;; Load a new theme with <SPC> t t.
  1834. (dotfiles/leader
  1835. "tt" '(counsel-load-theme :which-key "Theme"))
  1836. #+END_SRC
  1837. ** Doom Modeline
  1838. #+NAME: emacs-doom-modeline-package
  1839. #+BEGIN_SRC nix
  1840. epkgs.doom-modeline
  1841. #+END_SRC
  1842. Doom Modeline[fn:73] is a fancy and fast modeline inspired by minimalism design. It's integrated into Centaur Emacs, Doom Emacs, and Spacemacs.
  1843. #+NAME: emacs-doom-modeline-elisp
  1844. #+BEGIN_SRC emacs-lisp
  1845. ;; Add the `doom-modeline' after initialization.
  1846. (add-hook 'after-init-hook 'doom-modeline-mode)
  1847. (setq doom-modeline-height 16
  1848. doom-modeline-icon t)
  1849. #+END_SRC
  1850. * Footnotes
  1851. [fn:1] https://gnu.org
  1852. [fn:2] https://gnu.org/software/emacs/
  1853. [fn:3] https://literateprogramming.com/knuthweb.pdf
  1854. [fn:4] https://nixos.org/manual/nixos/stable
  1855. [fn:5] https://nixos.org/manual/nix/stable
  1856. [fn:6] https://nixos.org/manual/nixpkgs/stable
  1857. [fn:7] https://github.com/nix-community/home-manager
  1858. [fn:8] https://github.com/nix-community/emacs-overlay
  1859. [fn:9] https://github.com/nixos/nixos-hardware
  1860. [fn:10] https://github.com/t184256/nix-on-droid
  1861. [fn:11] https://qemu.org
  1862. [fn:12] https://github.com/ch11ng/exwm
  1863. [fn:13] https://evil.readthedocs.io/en/latest/overview.html
  1864. [fn:14] https://samsung.com/us/mobile/galaxy-s10/buy/
  1865. [fn:15] https://www.raspberrypi.org/products/raspberry-pi-4-model-b/
  1866. [fn:16] https://raspberrypi.org/products/raspberry-pi-400/
  1867. [fn:17] https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html
  1868. [fn:18] https://golang.org
  1869. [fn:19] https://grpc.io
  1870. [fn:20] https://iso.org/standard/74528.html
  1871. [fn:21] https://en.wikipedia.org/wiki/C++
  1872. [fn:22] https://python.org
  1873. [fn:23] https://x.org/wiki/
  1874. [fn:24] https://wayland.freedesktop.org
  1875. [fn:25] https://nixos.wiki/wiki/Flakes
  1876. [fn:26] https://nix-community.cachix.org
  1877. [fn:27] https://en.wikipedia.org/wiki/Firefox
  1878. [fn:28] https://jellyfin.org
  1879. [fn:29] https://moonlight-stream.org
  1880. [fn:30] https://teamviewer.com
  1881. [fn:31] https://git-scm.com
  1882. [fn:32] https://emacswiki.org/emacs/LearnEmacsLisp
  1883. [fn:33] https://neovim.io
  1884. [fn:34] https://gtk.org
  1885. [fn:35] https://github.com/nixos/nix-mode
  1886. [fn:36] https://github.com/noctuid/general.el
  1887. [fn:37] https://github.com/justbur/emacs-which-key
  1888. [fn:38] https://emacswiki.org/emacs/eww
  1889. [fn:39] https://emacswiki.org/emacs/DiredMode
  1890. [fn:40] https://emacswiki.org/emacs/DiredExtra#Dired_X
  1891. [fn:41] https://github.com/domtronn/all-the-icons.el
  1892. [fn:42] https://github.com/iqbalansari/emacs-emojify
  1893. [fn:43] https://gnu.org/software/emacs/manual/html_mono/eshell.html
  1894. [fn:44] https://github.com/akermu/emacs-libvterm
  1895. [fn:45] https://github.com/neovim/libvterm
  1896. [fn:46] https://magit.vc
  1897. [fn:47] https://github.com/skeeto/elfeed
  1898. [fn:48] https://orgmode.org
  1899. [fn:49] https://github.com/org-roam/org-roam
  1900. [fn:50] https://zettelkasten.de
  1901. [fn:51] https://github.com/org-roam/org-roam-server
  1902. [fn:52] https://orgmode.org/worg/org-contrib/org-drill.html
  1903. [fn:53] https://marcinkoziej/org-pomodoro
  1904. [fn:54] https://en.wikipedia.org/wiki/Pomodoro_Technique
  1905. [fn:55] https://github.com/bnbeckwith/writegood-mode
  1906. [fn:56] https://aspell.net
  1907. [fn:57] https://gohugo.io
  1908. [fn:58] https://oxhugo.scripter.co
  1909. [fn:59] https://chrishayward.xyz/posts/
  1910. [fn:60] https://chrishayward.xyz/notes/
  1911. [fn:61] https://revealjs.com
  1912. [fn:62] https://github.com/hexmode/ox-reveal
  1913. [fn:63] https://password-store.org
  1914. [fn:64] https://projectile.mx
  1915. [fn:65] https://microsoft.github.io/language-server-protocol
  1916. [fn:66] https://company-mode.github.io
  1917. [fn:67] https://emacswiki.org/emacs/GoMode
  1918. [fn:68] https://emacswiki.org/emacs/PythonProgrammingInEmacs
  1919. [fn:69] https://plantuml.com
  1920. [fn:70] https://github.com/skuro/plantuml-mode
  1921. [fn:71] https://github.com/abo-abo/swiper
  1922. [fn:72] https://github.com/hlissner/emacs-doom-themes
  1923. [fn:73] https://github.com/seagle0128/doom-modeline
  1924. [fn:74] https://laptopmedia.com/laptop-specs/acer-nitro-5-an515-53-2