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.

2508 lines
72 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
3 years ago
4 years ago
3 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 :noweb yes
  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-docker>>
  338. <<module-jellyfin>>
  339. ];
  340. };
  341. #+END_SRC
  342. Deploy this configuration with ~sudo nixos-rebuild switch --flake /etc/dotfiles/#homecloud~.
  343. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/default.nix
  344. # <<file-warning>
  345. { ... }:
  346. {
  347. imports = [
  348. ./configuration.nix
  349. ./hardware.nix
  350. ];
  351. }
  352. #+END_SRC
  353. *** TODO Configuration
  354. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/configuration.nix
  355. # <<file-warning>>
  356. { # TODO
  357. }
  358. #+END_SRC
  359. *** TODO Hardware
  360. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/hardware.nix
  361. # <<file-warning>>
  362. { # TODO
  363. }
  364. #+END_SRC
  365. ** TODO Raspberry
  366. 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.
  367. #+NAME: host-raspberry
  368. #+BEGIN_SRC nix :noweb yes
  369. raspberry = nixpkgs.lib.nixosSystem {
  370. system = "aarch64-linux";
  371. specialArgs = { inherit inputs; };
  372. modules = [
  373. ./hosts/raspberry
  374. <<module-flakes>>
  375. <<module-cachix>>
  376. ];
  377. };
  378. #+END_SRC
  379. Deploy this configuration with ~sudo nixos-rebuild switch --flake /etc/dotfiles/#raspberry~.
  380. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/default.nix
  381. # <<file-warning>>
  382. { ... }:
  383. {
  384. imports = [
  385. ./configuration.nix
  386. ./hardware.nix
  387. ];
  388. }
  389. #+END_SRC
  390. *** TODO Configuration
  391. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/configuration.nix
  392. # <<file-warning>>
  393. { # TODO
  394. }
  395. #+END_SRC
  396. *** TODO Hardware
  397. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/hardware.nix
  398. # <<file-warning>>
  399. { # TODO
  400. }
  401. #+END_SRC
  402. ** TODO Zero-One
  403. TODO: Raspberry Pi Zero/Zero WH
  404. #+NAME: host-zero-one
  405. #+BEGIN_SRC nix
  406. zero-one = nixpkgs.lib.nixosSystem {
  407. system = "armv7l-linux";
  408. specialArgs = { inherit inputs; };
  409. modules = [
  410. ./hosts/zero-one
  411. ./modules/flakes.nix
  412. ./modules/cachix.nix
  413. ];
  414. };
  415. #+END_SRC
  416. ** TODO Zero-Two
  417. #+NAME: host-zero-two
  418. #+BEGIN_SRC nix
  419. zero-two = nixpkgs.lib.nixosSystem {
  420. system = "armv7l-linux";
  421. specialArgs = { inherit inputs; };
  422. modules = [
  423. ./hosts/zero-one
  424. ./modules/flakes.nix
  425. ./modules/cachix.nix
  426. ];
  427. };
  428. #+END_SRC
  429. * Development Shells
  430. 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.
  431. Import this shell with ~nix-shell /etc/dotfiles/shell.nix~.
  432. #+BEGIN_SRC nix :noweb yes :tangle shell.nix
  433. # <<file-warning>>
  434. { pkgs ? import <nixpkgs> { } }:
  435. with pkgs;
  436. let
  437. nixBin = writeShellScriptBin "nix" ''
  438. ${nixFlakes}/bin/nix --option experimental-features "nix-command flakes" "$@"
  439. '';
  440. in mkShell {
  441. buildInputs = [
  442. git
  443. ];
  444. shellHook = ''
  445. export FLAKE="$(pwd)"
  446. export PATH="$FLAKE/bin:${nixBin}/bin:$PATH"
  447. '';
  448. }
  449. #+END_SRC
  450. ** Go
  451. 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.
  452. Import this shell with ~nix-shell /etc/dotfiles/shells/go.nix~
  453. #+BEGIN_SRC nix :noweb yes :tangle shells/go.nix
  454. # <<file-warning>>
  455. { pkgs ? import <nixpkgs> { } }:
  456. with pkgs;
  457. mkShell {
  458. buildInputs = [
  459. go
  460. gopls
  461. protoc-gen-go-grpc
  462. ];
  463. shellHook = ''
  464. export GO111MODULE=on
  465. export GOPATH=$HOME/.go/
  466. export PATH=$GOPATH/bin:$PATH
  467. '';
  468. }
  469. #+END_SRC
  470. ** gRPC
  471. 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.
  472. Import this shell with ~nix-shell /etc/dotfiles/shells/grpc.nix~
  473. #+BEGIN_SRC nix :noweb yes :tangle shells/grpc.nix
  474. # <<file-warning>>
  475. { pkgs ? import <nixpkgs> { } }:
  476. with pkgs;
  477. mkShell {
  478. buildInputs = [
  479. grpc
  480. grpc-tools
  481. grpcui
  482. grpcurl
  483. ];
  484. shellHook = ''
  485. '';
  486. }
  487. #+END_SRC
  488. ** C/C++
  489. 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.
  490. Import this shell with ~nix-shell /etc/dotfiles/shells/cc.nix~
  491. #+BEGIN_SRC nix :noweb yes :tangle shells/cc.nix
  492. # <<file-warning>>
  493. { pkgs ? import <nixpkgs> { } }:
  494. with pkgs;
  495. mkShell {
  496. buildInputs = [
  497. ccls
  498. gnumake
  499. libstdcxx5
  500. gcc-unwrapped
  501. ];
  502. shellHook = ''
  503. '';
  504. }
  505. #+END_SRC
  506. ** Python
  507. 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.
  508. Import this shell with ~nix-shell /etc/dotfiles/shells/python.nix~
  509. #+BEGIN_SRC nix :noweb yes :tangle shells/python.nix
  510. # <<file-warning>>
  511. { pkgs ? import <nixpkgs> { } }:
  512. with pkgs;
  513. mkShell {
  514. buildInputs = [
  515. python39Packages.pip
  516. python39Packages.pip-tools
  517. python39Packages.pyls-mypy
  518. python39Packages.pyls-isort
  519. python39Packages.pyls-black
  520. ];
  521. shellHook = ''
  522. '';
  523. }
  524. #+END_SRC
  525. * Module Definitions
  526. 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.
  527. ** X11
  528. #+NAME: module-x11
  529. #+BEGIN_SRC nix
  530. ./modules/x11.nix
  531. #+END_SRC
  532. 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.
  533. #+BEGIN_SRC nix :noweb yes :tangle modules/x11.nix
  534. # <<file-warning>>
  535. { config, pkgs, ... }:
  536. {
  537. services.xserver.enable = true;
  538. services.xserver.layout = "us";
  539. services.xserver.libinput.enable = true;
  540. services.xserver.displayManager.startx.enable = true;
  541. environment = {
  542. systemPackages = with pkgs; [
  543. pkgs.sqlite
  544. pkgs.pfetch
  545. pkgs.cmatrix
  546. pkgs.asciiquarium
  547. ];
  548. extraInit = ''
  549. export XAUTHORITY=/tmp/Xauthority
  550. export xserverauthfile=$XAUTHORITY
  551. [ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY"
  552. '';
  553. };
  554. services.picom.enable = true;
  555. services.openssh.enable = true;
  556. services.printing.enable = true;
  557. fonts.fonts = with pkgs; [
  558. iosevka
  559. emacs-all-the-icons-fonts
  560. ];
  561. }
  562. #+END_SRC
  563. ** Flakes
  564. #+NAME: module-flakes
  565. #+BEGIN_SRC nix
  566. ./modules/flakes.nix
  567. #+END_SRC
  568. 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.
  569. #+BEGIN_SRC nix :noweb yes :tangle modules/flakes.nix
  570. # <<file-warning>>
  571. { config, pkgs, inputs, ... }:
  572. {
  573. nix = {
  574. package = pkgs.nixUnstable;
  575. extraOptions = ''
  576. experimental-features = nix-command flakes
  577. '';
  578. };
  579. nixpkgs = {
  580. config = { allowUnfree = true; };
  581. overlays = [ inputs.emacs-overlay.overlay ];
  582. };
  583. }
  584. #+END_SRC
  585. ** Cachix
  586. #+NAME: module-cachix
  587. #+BEGIN_SRC nix
  588. ./modules/cachix.nix
  589. #+END_SRC
  590. 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.
  591. #+BEGIN_SRC nix :noweb yes :tangle modules/cachix.nix
  592. # <<file-warning>>
  593. { config, ... }:
  594. {
  595. nix = {
  596. binaryCaches = [
  597. "https://nix-community.cachix.org"
  598. ];
  599. binaryCachePublicKeys = [
  600. "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
  601. ];
  602. };
  603. }
  604. #+END_SRC
  605. ** Docker
  606. #+NAME: module-docker
  607. #+BEGIN_SRC nix
  608. ./modules/docker.nix
  609. #+END_SRC
  610. Docker [fn:27] is a set of platform as a service that uses OS level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries, and configuration files; they can communicate with each other through well-defined channels.
  611. #+BEGIN_SRC nix :noweb yes :tangle modules/docker.nix
  612. { config, pkgs, ... }:
  613. {
  614. virtualisation.docker = {
  615. enable = true;
  616. enableOnBoot = true;
  617. autoPrune.enable = true;
  618. };
  619. }
  620. #+END_SRC
  621. ** Firefox
  622. #+NAME: module-firefox
  623. #+BEGIN_SRC nix
  624. ./modules/firefox.nix
  625. #+END_SRC
  626. Firefox Browser[fn:28], 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.
  627. #+BEGIN_SRC nix :noweb yes :tangle modules/firefox.nix
  628. # <<file-warning>>
  629. { pkgs, ... }:
  630. {
  631. # NOTE: Use the binary until module is developed.
  632. environment.systemPackages = [
  633. pkgs.firefox-bin
  634. ];
  635. }
  636. #+END_SRC
  637. ** Jellyfin
  638. #+NAME: module-jellyfin
  639. #+BEGIN_SRC nix
  640. ./modules/jellyfin.nix
  641. #+END_SRC
  642. Jellyfin[fn:29] 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.
  643. #+BEGIN_SRC nix :noweb yes :tangle modules/jellyfin.nix
  644. # <<file-warning>>
  645. { config, pkgs, ... }:
  646. {
  647. services.jellyfin = {
  648. enable = true;
  649. };
  650. }
  651. #+END_SRC
  652. ** Moonlight
  653. #+NAME: module-moonlight
  654. #+BEGIN_SRC nix
  655. ./modules/moonlight.nix
  656. #+END_SRC
  657. Moonlight[fn:30] 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:30] is perfect for gaming on the go (or on GNU/Linux[fn:1]) without sacrificing the graphics and game selection available for the PC.
  658. #+BEGIN_SRC nix :noweb yes :tangle modules/moonlight.nix
  659. # <<file-warning>>
  660. { pkgs, ... }:
  661. {
  662. environment.systemPackages = [
  663. pkgs.moonlight-qt
  664. ];
  665. }
  666. #+END_SRC
  667. ** Teamviewer
  668. #+NAME: module-teamviewer
  669. #+BEGIN_SRC nix
  670. ./modules/teamviewer.nix
  671. #+END_SRC
  672. The Teamviewer[fn:31] remote connectivity cloud platform enables secure remote access to any device, across platforms, from anywhere, anytime. Teamviewer[fn:31] 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.
  673. #+BEGIN_SRC nix :noweb yes :tangle modules/teamviewer.nix
  674. # <<file-warning>>
  675. { pkgs, ... }:
  676. {
  677. # NOTE: Neither of these are working!
  678. # services.teamviewer.enable = true;
  679. # environment.systemPackages = [
  680. # pkgs.teamviewer
  681. # ];
  682. }
  683. #+END_SRC
  684. ** Home Manager
  685. 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.
  686. #+NAME: module-home-manager
  687. #+BEGIN_SRC nix :noweb yes
  688. inputs.home-manager.nixosModules.home-manager {
  689. home-manager.useGlobalPkgs = true;
  690. home-manager.useUserPackages = true;
  691. home-manager.users.chris = {
  692. imports = [
  693. <<module-git>>
  694. <<module-gpg>>
  695. <<module-vim>>
  696. <<module-gtk>>
  697. <<module-emacs>>
  698. ];
  699. };
  700. }
  701. #+END_SRC
  702. *** Git
  703. #+NAME: module-git
  704. #+BEGIN_SRC nix
  705. ./modules/git.nix
  706. #+END_SRC
  707. Git[fn:32] 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.
  708. #+BEGIN_SRC nix :noweb yes :tangle modules/git.nix
  709. # <<file-warning>>
  710. { pkgs, ... }:
  711. {
  712. programs.git = {
  713. enable = true;
  714. userName = "Christopher James Hayward";
  715. userEmail = "chris@chrishayward.xyz";
  716. signing = {
  717. key = "37AB1CB72B741E478CA026D43025DCBD46F81C0F";
  718. signByDefault = true;
  719. };
  720. };
  721. }
  722. #+END_SRC
  723. *** Gpg
  724. #+NAME: module-gpg
  725. #+BEGIN_SRC nix
  726. ./modules/gpg.nix
  727. #+END_SRC
  728. GNU Privacy Guard[fn:33] 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.
  729. #+BEGIN_SRC nix :noweb yes :tangle modules/gpg.nix
  730. # <<file-warning>>
  731. { pkgs, ... }:
  732. {
  733. services.gpg-agent = {
  734. enable = true;
  735. defaultCacheTtl = 1800;
  736. enableSshSupport = true;
  737. pinentryFlavor = "gtk2";
  738. };
  739. }
  740. #+END_SRC
  741. *** Vim
  742. #+NAME: module-vim
  743. #+BEGIN_SRC nix
  744. ./modules/vim.nix
  745. #+END_SRC
  746. Neovim[fn:34] is a project that seeks to aggressively refactor Vim in order to:
  747. + Simplify maintenance and encourage contributions
  748. + Split the work between multiple developers
  749. + Enable advanced UIs without core modification
  750. + Maximize extensibility
  751. #+BEGIN_SRC nix :noweb yes :tangle modules/vim.nix
  752. # <<file-warning>>
  753. { pkgs, ... }:
  754. {
  755. programs.neovim = {
  756. enable = true;
  757. viAlias = true;
  758. vimAlias = true;
  759. vimdiffAlias = true;
  760. extraConfig = ''
  761. set number relativenumber
  762. set nobackup
  763. '';
  764. extraPackages = [
  765. pkgs.nixfmt
  766. ];
  767. plugins = with pkgs.vimPlugins; [
  768. vim-nix
  769. vim-airline
  770. vim-polyglot
  771. ];
  772. };
  773. }
  774. #+END_SRC
  775. *** GTK
  776. #+NAME: module-gtk
  777. #+BEGIN_SRC nix
  778. ./modules/gtk.nix
  779. #+END_SRC
  780. GTK[fn:35] 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.
  781. #+BEGIN_SRC nix :noweb yes :tangle modules/gtk.nix
  782. # <<file-warning>>
  783. { pkgs, ... }:
  784. {
  785. home.packages = [
  786. pkgs.arc-theme
  787. pkgs.arc-icon-theme
  788. pkgs.lxappearance
  789. ];
  790. home.file.".gtkrc-2.0" = {
  791. text = ''
  792. gtk-theme-name="Arc-Dark"
  793. gtk-icon-theme-name="Arc"
  794. gtk-font-name="Sans 10"
  795. gtk-cursor-theme-size=0
  796. gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
  797. gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
  798. gtk-button-images=0
  799. gtk-menu-images=0
  800. gtk-enable-event-sounds=1
  801. gtk-enable-input-feedback-sounds=1
  802. gtk-xft-antialias=1
  803. gtk-xft-hinting=1
  804. gtk-xft-hintstyle="hintmedium"
  805. '';
  806. };
  807. }
  808. #+END_SRC
  809. * Emacs Configuration
  810. #+NAME: module-emacs
  811. #+BEGIN_SRC nix
  812. ./modules/emacs.nix
  813. #+END_SRC
  814. GNU/Emacs[fn:2] is an extensible, customizable, free/libre text editor -- and more. At its core is an interpreter for Emacs Lisp[fn:33], a dialect of the Lisp programming language with extensions to support text editing. Other features include:
  815. + Highly customizable
  816. + Full Unicopde support
  817. + Content-aware editing modes
  818. + Complete built-in documentation
  819. + Wide range of functionality beyond text editing
  820. #+BEGIN_SRC nix :noweb yes :tangle modules/emacs.nix
  821. # <<file-warning>>
  822. { pkgs, ... }:
  823. let
  824. myEmacs = pkgs.emacsWithPackagesFromUsePackage {
  825. config = ../README.org;
  826. package = <<emacs-native-comp-package>>
  827. alwaysEnsure = true;
  828. alwaysTangle = true;
  829. extraEmacsPackages = epkgs: [
  830. # Required packages...
  831. <<emacs-exwm-package>>
  832. <<emacs-evil-package>>
  833. <<emacs-general-package>>
  834. <<emacs-which-key-package>>
  835. # Optional packages.
  836. <<emacs-org-package>>
  837. <<emacs-org-roam-package>>
  838. <<emacs-org-drill-package>>
  839. <<emacs-pomodoro-package>>
  840. <<emacs-writegood-package>>
  841. <<emacs-hugo-package>>
  842. <<emacs-reveal-package>>
  843. <<emacs-pass-package>>
  844. <<emacs-mu4e-package>>
  845. <<emacs-dired-package>>
  846. <<emacs-icons-package>>
  847. <<emacs-emoji-package>>
  848. <<emacs-eshell-package>>
  849. <<emacs-vterm-package>>
  850. <<emacs-magit-package>>
  851. <<emacs-fonts-package>>
  852. <<emacs-elfeed-package>>
  853. <<emacs-nix-mode-package>>
  854. <<emacs-projectile-package>>
  855. <<emacs-lsp-package>>
  856. <<emacs-company-package>>
  857. <<emacs-golang-package>>
  858. <<emacs-python-package>>
  859. <<emacs-plantuml-package>>
  860. <<emacs-swiper-package>>
  861. <<emacs-doom-themes-package>>
  862. <<emacs-doom-modeline-package>>
  863. ];
  864. };
  865. in {
  866. home.packages = [
  867. <<emacs-exwm-extras>>
  868. <<emacs-hugo-extras>>
  869. <<emacs-pass-extras>>
  870. <<emacs-mu4e-extras>>
  871. <<emacs-aspell-extras>>
  872. <<emacs-plantuml-extras>>
  873. <<emacs-nix-mode-extras>>
  874. ];
  875. programs.emacs = {
  876. enable = true;
  877. package = myEmacs;
  878. };
  879. <<emacs-exwm-config>>
  880. <<emacs-exwm-xinitrc>>
  881. <<emacs-mu4e-config>>
  882. }
  883. #+END_SRC
  884. 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.
  885. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/init.el
  886. ;; <<file-warning>>
  887. ;; Required inputs.
  888. <<emacs-exwm-elisp>>
  889. <<emacs-evil-elisp>>
  890. <<emacs-general-elisp>>
  891. <<emacs-which-key-elisp>>
  892. ;; Optional inputs.
  893. <<emacs-org-elisp>>
  894. <<emacs-org-roam-elisp>>
  895. <<emacs-org-drill-elisp>>
  896. <<emacs-org-agenda-elisp>>
  897. <<emacs-pomodoro-elisp>>
  898. <<emacs-writegood-elisp>>
  899. <<emacs-aspell-elisp>>
  900. <<emacs-eww-elisp>>
  901. <<emacs-hugo-elisp>>
  902. <<emacs-reveal-elisp>>
  903. <<emacs-pass-elisp>>
  904. <<emacs-mu4e-elisp>>
  905. <<emacs-dired-elisp>>
  906. <<emacs-icons-elisp>>
  907. <<emacs-emoji-elisp>>
  908. <<emacs-eshell-elisp>>
  909. <<emacs-vterm-elisp>>
  910. <<emacs-magit-elisp>>
  911. <<emacs-fonts-elisp>>
  912. <<emacs-elfeed-elisp>>
  913. <<emacs-projectile-elisp>>
  914. <<emacs-lsp-elisp>>
  915. <<emacs-company-elisp>>
  916. <<emacs-golang-elisp>>
  917. <<emacs-python-elisp>>
  918. <<emacs-plantuml-elisp>>
  919. ;; User interface.
  920. <<emacs-swiper-elisp>>
  921. <<emacs-transparency-elisp>>
  922. <<emacs-doom-themes-elisp>>
  923. <<emacs-doom-modeline-elisp>>
  924. #+END_SRC
  925. 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=.
  926. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/early-init.el
  927. ;; <<file-warning>>
  928. <<emacs-disable-ui-elisp>>
  929. <<emacs-native-comp-elisp>>
  930. <<emacs-backup-files-elisp>>
  931. <<emacs-shell-commands-elisp>>
  932. #+END_SRC
  933. ** Disable UI
  934. 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.
  935. #+NAME: emacs-disable-ui-elisp
  936. #+BEGIN_SRC emacs-lisp
  937. ;; Disable unwanted UI elements.
  938. (tooltip-mode -1)
  939. (menu-bar-mode -1)
  940. (tool-bar-mode -1)
  941. (scroll-bar-mode -1)
  942. ;; Fix the scrolling behaviour.
  943. (setq scroll-conservatively 101)
  944. ;; Fix mouse-wheel scrolling behaviour.
  945. (setq mouse-wheel-follow-mouse t
  946. mouse-wheel-progressive-speed t
  947. mouse-wheel-scroll-amount '(3 ((shift) . 3)))
  948. #+END_SRC
  949. ** Native Comp
  950. #+NAME: emacs-native-comp-package
  951. #+BEGIN_SRC nix
  952. pkgs.emacsGcc;
  953. #+END_SRC
  954. 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.
  955. #+NAME: emacs-native-comp-elisp
  956. #+BEGIN_SRC emacs-lisp
  957. ;; Silence warnings from packages that don't support `native-comp'.
  958. (setq comp-async-report-warnings-errors nil ;; Emacs 27.2 ...
  959. native-comp-async-report-warnings-errors nil) ;; Emacs 28+ ...
  960. #+END_SRC
  961. ** Backup Files
  962. 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.
  963. #+NAME: emacs-backup-files-elisp
  964. #+BEGIN_SRC emacs-lisp
  965. ;; Disable unwanted features.
  966. (setq make-backup-files nil
  967. create-lockfiles nil)
  968. #+END_SRC
  969. ** Shell Commands
  970. Define some methods for interaction between GNU/Emacs[fn:2], and the systems underyling shell:
  971. 1) Method to run an external process, launching any application on a new process without interferring with Emacs[fn:2]
  972. 2) Method to apply commands to the curren call process, effecting the running instance of Emacs[fn:2]
  973. #+NAME: emacs-shell-commands-elisp
  974. #+BEGIN_SRC emacs-lisp
  975. ;; Define a method to run an external process.
  976. (defun dotfiles/run (cmd)
  977. "Run an external process."
  978. (interactive (list (read-shell-command "λ ")))
  979. (start-process-shell-command cmd nil cmd))
  980. ;; Define a method to run a background process.
  981. (defun dotfiles/run-in-background (cmd)
  982. (let ((command-parts (split-string cmd "[ ]+")))
  983. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  984. #+END_SRC
  985. ** Nix Mode
  986. #+NAME: emacs-nix-mode-extras
  987. #+BEGIN_SRC nix
  988. pkgs.nixfmt
  989. #+END_SRC
  990. Nix-mode[fn:36] 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.
  991. #+NAME: emacs-nix-mode-package
  992. #+BEGIN_SRC nix
  993. epkgs.nix-mode
  994. #+END_SRC
  995. ** Evil Mode
  996. Evil[fn:13] is an extensible VI layer for GNU/Emacs[fn:2]. It emulates the main features of Vim[fn:34], turning GNU/Emacs[fn:2] into a modal editor.
  997. #+NAME: emacs-evil-package
  998. #+BEGIN_SRC nix
  999. epkgs.evil
  1000. epkgs.evil-collection
  1001. epkgs.evil-surround
  1002. epkgs.evil-nerd-commenter
  1003. #+END_SRC
  1004. 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:33].
  1005. #+NAME: emacs-evil-elisp
  1006. #+BEGIN_SRC emacs-lisp
  1007. ;; Enable the Extensible VI Layer for Emacs.
  1008. (setq evil-want-integration t ;; Required for `evil-collection.'
  1009. evil-want-keybinding nil) ;; Same as above.
  1010. (evil-mode +1)
  1011. ;; Configure `evil-collection'.
  1012. (evil-collection-init)
  1013. ;; Configure `evil-surround'.
  1014. (global-evil-surround-mode +1)
  1015. ;; Configure `evil-nerd-commenter'.
  1016. (global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
  1017. #+END_SRC
  1018. ** EXWM
  1019. #+NAME: emacs-exwm-package
  1020. #+BEGIN_SRC nix
  1021. epkgs.exwm
  1022. #+END_SRC
  1023. 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:
  1024. + Fully keyboard-driven operations
  1025. + Hybrid layout modes (tiling & stacking)
  1026. + Dynamic workspace support
  1027. + ICCM/EWMH compliance
  1028. #+NAME: emacs-exwm-extras
  1029. #+BEGIN_SRC nix
  1030. pkgs.nitrogen
  1031. pkgs.autorandr
  1032. #+END_SRC
  1033. 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].
  1034. #+NAME: emacs-exwm-config
  1035. #+BEGIN_SRC nix
  1036. xsession = {
  1037. enable = true;
  1038. windowManager.command = ''
  1039. ${pkgs.nitrogen}/bin/nitrogen --restore
  1040. ${myEmacs}/bin/emacs --daemon -f exwm-enable
  1041. ${myEmacs}/bin/emacsclient -c
  1042. '';
  1043. };
  1044. #+END_SRC
  1045. 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=.
  1046. #+NAME: emacs-exwm-xinitrc
  1047. #+BEGIN_SRC nix
  1048. home.file.".xinitrc" = {
  1049. text = ''
  1050. exec ./.xsession
  1051. '';
  1052. };
  1053. #+END_SRC
  1054. #+NAME: emacs-exwm-elisp
  1055. #+BEGIN_SRC emacs-lisp
  1056. ;; Configure `exwm'.
  1057. (setq exwm-worspace-show-all-buffers t)
  1058. (setq exwm-input-prefix-keys
  1059. '(?\M-x
  1060. ?\C-g
  1061. ?\C-\ ))
  1062. (setq exwm-input-global-keys
  1063. `(([?\s-r] . exwm-reset)
  1064. ,@(mapcar (lambda (i)
  1065. `(,(kbd (format "s-%d" i)) .
  1066. (lambda ()
  1067. (interactive)
  1068. (exwm-workspace-switch-create ,i))))
  1069. (number-sequence 1 9))))
  1070. ;; Configure `exwm-randr'.
  1071. (require 'exwm-randr)
  1072. (exwm-randr-enable)
  1073. ;; Configure custom hooks.
  1074. (setq display-time-and-date t)
  1075. (add-hook 'exwm-init-hook
  1076. (lambda ()
  1077. (display-battery-mode +1) ;; Display battery info (if available).
  1078. (display-time-mode +1))) ;; Display the time in the modeline.
  1079. ;; Setup buffer display names.
  1080. (add-hook 'exwm-update-class-hook
  1081. (lambda ()
  1082. (exwm-workspace-rename-buffer exwm-class-name))) ;; Use the system class name.
  1083. ;; Configure monitor hot-swapping.
  1084. (add-hook 'exwm-randr-screen-change-hook
  1085. (lambda ()
  1086. (dotfiles/run-in-background "autorandr --change --force"))) ;; Swap to the next screen config.
  1087. #+END_SRC
  1088. ** General
  1089. #+NAME: emacs-general-package
  1090. #+BEGIN_SRC nix
  1091. epkgs.general
  1092. #+END_SRC
  1093. General[fn:37] 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.
  1094. #+NAME: emacs-general-elisp
  1095. #+BEGIN_SRC emacs-lisp
  1096. ;; Use <SPC> as a leader key via `general.el'.
  1097. (general-create-definer dotfiles/leader
  1098. :states '(normal motion)
  1099. :keymaps 'override
  1100. :prefix "SPC"
  1101. :global-prefix "C-SPC")
  1102. ;; Find files with <SPC> <period> ...
  1103. ;; Switch buffers with <SPC> <comma> ...
  1104. (dotfiles/leader
  1105. "." '(find-file :which-key "File")
  1106. "," '(switch-to-buffer :which-key "Buffer")
  1107. "c" '(kill-buffer-and-window :which-key "Close"))
  1108. ;; Add keybindings for executing shell commands.
  1109. (dotfiles/leader
  1110. "r" '(:ignore t :which-key "Run")
  1111. "rr" '(dotfiles/run :which-key "Run")
  1112. "ra" '(async-shell-command :which-key "Async"))
  1113. ;; Add keybindings for quitting Emacs.
  1114. (dotfiles/leader
  1115. "q" '(:ignore t :which-key "Quit")
  1116. "qq" '(save-buffers-kill-emacs :which-key "Save")
  1117. "qw" '(kill-emacs :which-key "Now")
  1118. "qf" '(delete-frame :which-key "Frame"))
  1119. ;; Add keybindings for toggles / tweaks.
  1120. (dotfiles/leader
  1121. "t" '(:ignore t :which-key "Toggle / Tweak"))
  1122. ;; Add keybindings for working with frames to replace
  1123. ;; the C-x <num> <num> method of bindings, which is awful.
  1124. (dotfiles/leader
  1125. "w" '(:ignore t :which-key "Windows")
  1126. "ww" '(window-swap-states :which-key "Swap")
  1127. "wc" '(delete-window :which-key "Close")
  1128. "wh" '(windmove-left :which-key "Left")
  1129. "wj" '(windmove-down :which-key "Down")
  1130. "wk" '(windmove-up :which-key "Up")
  1131. "wl" '(windmove-right :which-key "Right")
  1132. "ws" '(:ignore t :which-key "Split")
  1133. "wsj" '(split-window-below :which-key "Below")
  1134. "wsl" '(split-window-right :which-key "Right"))
  1135. #+END_SRC
  1136. ** Which Key
  1137. Which-key[fn:38] 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.
  1138. #+NAME: emacs-which-key-package
  1139. #+BEGIN_SRC nix
  1140. epkgs.which-key
  1141. #+END_SRC
  1142. #+NAME: emacs-which-key-elisp
  1143. #+BEGIN_SRC emacs-lisp
  1144. ;; Configure `which-key' to see keyboard bindings in the
  1145. ;; mini-buffer and when using M-x.
  1146. (setq which-key-idle-delay 0.0)
  1147. (which-key-mode +1)
  1148. #+END_SRC
  1149. ** EWW
  1150. The Emacs Web Wowser[fn:39] is a Web browser written in Emacs Lisp[fn:33] based on the ~shr.el~ library. It's my primary browser when it comes to text-based browsing.
  1151. + Use ~eww~ as the default browser
  1152. + Don't use any special fonts or colours
  1153. #+NAME: emacs-eww-elisp
  1154. #+BEGIN_SRC emacs-lisp
  1155. ;; Set `eww' as the default browser.
  1156. (setq browse-url-browser-function 'eww-browse-url)
  1157. ;; Configure the `shr' rendering engine.
  1158. (setq shr-use-fonts nil
  1159. shr-use-colors nil)
  1160. #+END_SRC
  1161. ** Dired
  1162. #+NAME: emacs-dired-package
  1163. #+BEGIN_SRC nix
  1164. epkgs.dired-single
  1165. #+END_SRC
  1166. Dired[fn:40] 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:41] provides extra functionality for Dired[fn:40].
  1167. #+NAME: emacs-dired-elisp
  1168. #+BEGIN_SRC emacs-lisp
  1169. ;; Include `dired-x' for the `jump' method.
  1170. (require 'dired-x)
  1171. ;; Configure `dired-single' to support `evil' keys.
  1172. (evil-collection-define-key 'normal 'dired-mode-map
  1173. "h" 'dired-single-up-directory
  1174. "l" 'dired-single-buffer)
  1175. ;; Setup `all-the-icons' and the `dired' extension.
  1176. ;; Configure keybindings for `dired'.
  1177. (dotfiles/leader
  1178. "d" '(dired-jump :which-key "Dired"))
  1179. #+END_SRC
  1180. ** Icons
  1181. #+NAME: emacs-icons-package
  1182. #+BEGIN_SRC nix
  1183. epkgs.all-the-icons
  1184. epkgs.all-the-icons-dired
  1185. #+END_SRC
  1186. All The Icons[fn:42] is a utility package to collect various Icon Fonts and prioritize them within GNU/Emacs[fn:2].
  1187. #+NAME: emacs-icons-elisp
  1188. #+BEGIN_SRC emacs-lisp
  1189. ;; Setup `all-the-icons-dired'.
  1190. (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
  1191. ;; Display default font ligatures.
  1192. (global-prettify-symbols-mode +1)
  1193. #+END_SRC
  1194. ** Emojis
  1195. #+NAME: emacs-emoji-package
  1196. #+BEGIN_SRC nix
  1197. epkgs.emojify
  1198. #+END_SRC
  1199. Emojify[fn:43] 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.
  1200. #+NAME: emacs-emoji-elisp
  1201. #+BEGIN_SRC emacs-lisp
  1202. ;; Setup `emojify'.
  1203. (add-hook 'after-init-hook 'global-emojify-mode)
  1204. #+END_SRC
  1205. ** EShell
  1206. #+NAME: emacs-eshell-package
  1207. #+BEGIN_SRC nix
  1208. epkgs.eshell-prompt-extras
  1209. #+END_SRC
  1210. EShell [fn:44] is a shell-like command interpreter for GNU/Emacs[fn:2] implemented in Emacs Lisp[fn:33]. 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].
  1211. #+NAME: emacs-eshell-elisp
  1212. #+BEGIN_SRC emacs-lisp
  1213. ;; Configure `eshell'.
  1214. (setq eshell-highlight-prompt nil
  1215. eshell-prefer-lisp-functions nil)
  1216. ;; Configure the lambda prompt.
  1217. (autoload 'epe-theme-lambda "eshell-prompt-extras")
  1218. (setq eshell-prompt-function 'epe-theme-lambda)
  1219. ;; Configure keybindings for `eshell'.
  1220. (dotfiles/leader
  1221. "e" '(eshell :which-key "EShell"))
  1222. #+END_SRC
  1223. ** VTerm
  1224. Emacs Libvterm (VTerm)[fn:45] is a fully-fledged terminal emulator inside GNU/Emacs[fn:2] based on Libvterm[fn:46], a blazing fast C library used in Neovim[fn:34]. As a result of using compiled code (instead of Emacs Lisp[fn:33]), VTerm[fn:45] is capable, fast, and it can seamlessly handle large outputs.
  1225. #+NAME: emacs-vterm-package
  1226. #+BEGIN_SRC nix
  1227. epkgs.vterm
  1228. #+END_SRC
  1229. #+NAME: emacs-vterm-elisp
  1230. #+BEGIN_SRC emacs-lisp
  1231. ;; Add keybindings for interacting with the shell(s).
  1232. (dotfiles/leader
  1233. "v" '(vterm :which-key "VTerm"))
  1234. #+END_SRC
  1235. ** Magit
  1236. Magit[fn:47] is an interface to the Git[fn:32] version control system, implemented as a GNU/Emacs[fn:2] package written in Elisp[fn:33]. It fills the glaring gap between the Git[fn:32] command line interface and various GUIs, letting you perform trivial as well as elaborate version control tasks within a few mnemonic key presses.
  1237. #+NAME: emacs-magit-package
  1238. #+BEGIN_SRC nix
  1239. epkgs.magit
  1240. #+END_SRC
  1241. | Key | Description |
  1242. |-----+--------------------------------------|
  1243. | gg | Check the status of a repository |
  1244. | gc | Clone a remote repository |
  1245. | gf | Fetch the contents of the repository |
  1246. | gp | Pull the remotes of the repository |
  1247. #+NAME: emacs-magit-elisp
  1248. #+BEGIN_SRC emacs-lisp
  1249. ;; Add keybindings for working with `magit'.
  1250. (dotfiles/leader
  1251. "g" '(:ignore t :which-key "Git")
  1252. "gg" '(magit-status :which-key "Status")
  1253. "gc" '(magit-clone :which-key "Clone")
  1254. "gf" '(magit-fetch :which-key "Fetch")
  1255. "gp" '(magit-pull :which-key "Pull"))
  1256. #+END_SRC
  1257. ** Fonts
  1258. #+NAME: emacs-fonts-package
  1259. #+BEGIN_SRC nix
  1260. epkgs.hydra
  1261. #+END_SRC
  1262. #+NAME: emacs-fonts-elisp
  1263. #+BEGIN_SRC emacs-lisp
  1264. ;; Configure the font when running as `emacs-server'.
  1265. (custom-set-faces
  1266. '(default ((t (:inherit nil :height 96 :family "Iosevka")))))
  1267. ;; Set all three of Emacs' font faces.
  1268. ;; NOTE: This only works without `emacs-server'.
  1269. ;; (set-face-attribute 'default nil :font "Iosevka" :height 96)
  1270. ;; (set-face-attribute 'fixed-pitch nil :font "Iosevka" :height 96)
  1271. ;; (set-face-attribute 'variable-pitch nil :font "Iosevka" :height 96)
  1272. ;; Define a `hydra' function for scaling the text interactively.
  1273. (defhydra hydra-text-scale (:timeout 4)
  1274. "Scale text"
  1275. ("j" text-scale-decrease "Decrease")
  1276. ("k" text-scale-increase "Increase")
  1277. ("f" nil "Finished" :exit t))
  1278. ;; Create keybinding for calling the function.
  1279. (dotfiles/leader
  1280. "tf" '(hydra-text-scale/body :which-key "Font"))
  1281. #+END_SRC
  1282. ** Elfeed
  1283. #+NAME: emacs-elfeed-package
  1284. #+BEGIN_SRC nix
  1285. epkgs.elfeed
  1286. #+END_SRC
  1287. Elfeed[fn:48] 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.
  1288. | Key | Command |
  1289. |-----+---------|
  1290. | l | Open |
  1291. | u | Update |
  1292. #+NAME: emacs-elfeed-elisp
  1293. #+BEGIN_SRC emacs-lisp
  1294. ;; Add custom feeds for `elfeed' to fetch.
  1295. (setq elfeed-feeds (quote
  1296. (("https://hexdsl.co.uk/rss.xml")
  1297. ("https://lukesmith.xyz/rss.xml")
  1298. ("https://friendo.monster/rss.xml")
  1299. ("https://chrishayward.xyz/index.xml")
  1300. ("https://protesilaos.com/codelog.xml"))))
  1301. ;; Add custom keybindings for `elfeed'.
  1302. (dotfiles/leader
  1303. "l" '(:ignore t :which-key "Elfeed")
  1304. "ll" '(elfeed :which-key "Open")
  1305. "lu" '(elfeed-update :which-key "Update"))
  1306. #+END_SRC
  1307. ** Org Mode
  1308. #+NAME: emacs-org-package
  1309. #+BEGIN_SRC nix
  1310. epkgs.org
  1311. #+END_SRC
  1312. Org-mode[fn:49] 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.
  1313. #+NAME: emacs-org-elisp
  1314. #+BEGIN_SRC emacs-lisp
  1315. ;; Configure `org-mode' source blocks.
  1316. (setq org-src-fontify-natively t ;; Make source blocks prettier.
  1317. org-src-tab-acts-natively t ;; Use TAB indents within source blocks.
  1318. org-src-preserve-indentation t) ;; Stop `org-mode' from formatting blocks.
  1319. ;; Add an `org-mode-hook'.
  1320. (add-hook 'org-mode-hook
  1321. (lambda ()
  1322. (org-indent-mode)
  1323. (visual-line-mode)))
  1324. ;; Remove the `Validate XHTML 1.0' message from HTML export.
  1325. (setq org-export-html-validation-link nil
  1326. org-html-validation-link nil)
  1327. ;; TODO: Configure default structure templates.
  1328. ;; (require 'org-tempo)
  1329. ;; Apply custom keybindings.
  1330. (dotfiles/leader
  1331. "o" '(:ignore t :which-key "Org")
  1332. "oe" '(org-export-dispatch :which-key "Export")
  1333. "ot" '(org-babel-tangle :which-key "Tangle")
  1334. "oi" '(org-toggle-inline-images :which-key "Images")
  1335. "of" '(:ignore t :which-key "Footnotes")
  1336. "ofn" '(org-footnote-normalize :which-key "Normalize"))
  1337. #+END_SRC
  1338. ** Org Roam
  1339. #+NAME: emacs-org-roam-package
  1340. #+BEGIN_SRC nix
  1341. epkgs.org-roam
  1342. epkgs.org-roam-server
  1343. #+END_SRC
  1344. Org Roam[fn:50] is a plain-text knowledge management system. It borrows principles from the Zettelkasten method[fn:51], 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:49] for their personal wiki (me). Org Roam Server[fn:52] is a Web application to visualize the Org Roam[fn:50] 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.
  1345. #+NAME: emacs-org-roam-elisp
  1346. #+BEGIN_SRC emacs-lisp
  1347. ;; Setup `org-roam' hooks.
  1348. (add-hook 'after-init-hook
  1349. (lambda ()
  1350. (org-roam-mode)
  1351. (org-roam-server-mode)))
  1352. ;; Configure `org-roam'.
  1353. (setq org-roam-encrypt-files t
  1354. org-roam-directory (expand-file-name "/etc/dotfiles")
  1355. org-roam-capture-templates '()
  1356. org-roam-dailies-capture-templates '())
  1357. ;; Encrypt files with the public key.
  1358. (setq epa-file-select-keys 2
  1359. epa-file-encrypt-to "37AB1CB72B741E478CA026D43025DCBD46F81C0F"
  1360. epa-cache-passphrase-for-symmetric-encryption t)
  1361. ;; Define a new `title-to-slug' function to override the default `org-roam-title-to-slug' function.
  1362. ;; This is done to change the replacement character from "_" to "-".
  1363. (require 'cl-lib)
  1364. (defun dotfiles/title-to-slug (title)
  1365. "Convert TITLE to a filename-suitable slug."
  1366. (cl-flet* ((nonspacing-mark-p (char)
  1367. (eq 'Mn (get-char-code-property char 'general-category)))
  1368. (strip-nonspacing-marks (s)
  1369. (apply #'string (seq-remove #'nonspacing-mark-p
  1370. (ucs-normalize-NFD-string s))))
  1371. (cl-replace (title pair)
  1372. (replace-regexp-in-string (car pair) (cdr pair) title)))
  1373. (let* ((pairs `(("[^[:alnum:][:digit:]]" . "-") ;; Convert anything not alphanumeric.
  1374. ("--*" . "-") ;; Remove sequential dashes.
  1375. ("^-" . "") ;; Remove starting dashes.
  1376. ("-$" . ""))) ;; Remove ending dashes.
  1377. (slug (-reduce-from #'cl-replace (strip-nonspacing-marks title) pairs)))
  1378. (downcase slug))))
  1379. (setq org-roam-title-to-slug-function #'dotfiles/title-to-slug)
  1380. ;; Configure capture templates.
  1381. ;; Standard document.
  1382. (add-to-list 'org-roam-capture-templates
  1383. '("d" "Default" entry (function org-roam-capture--get-point)
  1384. "%?"
  1385. :file-name "docs/${slug}"
  1386. :unnarrowed t
  1387. :head
  1388. "
  1389. ,#+TITLE: ${title}
  1390. ,#+AUTHOR: Christopher James Hayward
  1391. ,#+EMAIL: chris@chrishayward.xyz
  1392. "))
  1393. ;; Course document.
  1394. (add-to-list 'org-roam-capture-templates
  1395. '("c" "Course" plain (function org-roam-capture--get-point)
  1396. "%?"
  1397. :file-name "docs/courses/${slug}"
  1398. :unnarrowed t
  1399. :head
  1400. "
  1401. ,#+TITLE: ${title}
  1402. ,#+SUBTITLE:
  1403. ,#+AUTHOR: Christopher James Hayward
  1404. ,#+EMAIL: chris@chrishayward.xyz
  1405. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1406. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1407. "))
  1408. ;; Daily notes.
  1409. (add-to-list 'org-roam-dailies-capture-templates
  1410. '("d" "Default" entry (function org-roam-capture--get-point)
  1411. "* %?"
  1412. :file-name "docs/daily/%<%Y-%m-%d>"
  1413. :head
  1414. "
  1415. ,#+TITLE: %<%Y-%m-%d>
  1416. ,#+AUTHOR: Christopher James Hayward
  1417. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1418. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1419. "))
  1420. ;; Apply custom keybindings.
  1421. (dotfiles/leader
  1422. "or" '(:ignore t :which-key "Roam")
  1423. "ori" '(org-roam-insert :which-key "Insert")
  1424. "orf" '(org-roam-find-file :which-key "Find")
  1425. "orc" '(org-roam-capture :which-key "Capture")
  1426. "orb" '(org-roam-buffer-toggle-display :which-key "Buffer"))
  1427. ;; Apply custom keybindings for dailies.
  1428. (dotfiles/leader
  1429. "ord" '(:ignore t :which-key "Dailies")
  1430. "ordd" '(org-roam-dailies-find-date :which-key "Date")
  1431. "ordt" '(org-roam-dailies-find-today :which-key "Today")
  1432. "ordm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
  1433. "ordy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
  1434. #+END_SRC
  1435. ** Org Drill
  1436. #+NAME: emacs-org-drill-package
  1437. #+BEGIN_SRC nix
  1438. epkgs.org-drill
  1439. #+END_SRC
  1440. Org Drill[fn:53] is an extension for Org Mode[fn:49] that uses a spaced repition algorithm to conduct interactive /Drill Sessions/ using Org files as sources of facts to be memorized.
  1441. #+NAME: emacs-org-drill-elisp
  1442. #+BEGIN_SRC emacs-lisp
  1443. ;; Configure keybindings for `org-drill'.
  1444. (dotfiles/leader
  1445. "od" '(:ignore t :which-key "Drill")
  1446. "odd" '(org-drill :which-key "Drill")
  1447. "odc" '(org-drill-cram :which-key "Cram")
  1448. "odr" '(org-drill-resume :which-key "Resume"))
  1449. #+END_SRC
  1450. ** Org Agenda
  1451. The way Org Mode[fn:49] 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.
  1452. #+NAME: emacs-org-agenda-elisp
  1453. #+BEGIN_SRC emacs-lisp
  1454. ;; Configure `org-agenda' to use the project files.
  1455. (setq org-agenda-files '("/etc/dotfiles/"
  1456. "/etc/dotfiles/docs/"
  1457. "/etc/dotfiles/docs/courses/"
  1458. "/etc/dotfiles/docs/daily/"
  1459. "/etc/dotfiles/docs/notes/"
  1460. "/etc/dotfiles/docs/posts/"
  1461. "/etc/dotfiles/docs/slides/"))
  1462. ;; Include files encrypted with `gpg'.
  1463. (require 'org)
  1464. (unless (string-match-p "\\.gpg" org-agenda-file-regexp)
  1465. (setq org-agenda-file-regexp
  1466. (replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?"
  1467. org-agenda-file-regexp)))
  1468. ;; Open an agenda buffer with SPC o a.
  1469. (dotfiles/leader
  1470. "oa" '(org-agenda :which-key "Agenda"))
  1471. #+END_SRC
  1472. ** Org Pomodoro
  1473. #+NAME: emacs-pomodoro-package
  1474. #+BEGIN_SRC nix
  1475. epkgs.org-pomodoro
  1476. #+END_SRC
  1477. Org Pomodoro[fn:54] adds basic support for the Pomodoro Technique[fn:55] 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.
  1478. #+NAME: emacs-pomodoro-elisp
  1479. #+BEGIN_SRC emacs-lisp
  1480. ;; Configure `org-pomodor' with the overtime workflow.
  1481. (setq org-pomodoro-manual-break t
  1482. org-pomodoro-keep-killed-time t)
  1483. ;; Configure keybindings.
  1484. (dotfiles/leader
  1485. "op" '(org-pomodoro :which-key "Pomodoro"))
  1486. #+END_SRC
  1487. ** Writegood Mode
  1488. #+NAME: emacs-writegood-package
  1489. #+BEGIN_SRC nix
  1490. epkgs.writegood-mode
  1491. #+END_SRC
  1492. Writegood Mode[fn:56] is an Emacs[fn:2] minor mode to aid in finding common writing problems. It highlights the text based on the following criteria:
  1493. + Weasel Words
  1494. + Passive Voice
  1495. + Duplicate Words
  1496. #+NAME: emacs-writegood-elisp
  1497. #+BEGIN_SRC emacs-lisp
  1498. ;; Configure `writegood-mode'.
  1499. (dotfiles/leader
  1500. "tg" '(writegood-mode :which-key "Grammar"))
  1501. #+END_SRC
  1502. ** Aspell
  1503. #+NAME: emacs-aspell-extras
  1504. #+BEGIN_SRC nix
  1505. pkgs.aspell
  1506. pkgs.aspellDicts.en
  1507. pkgs.aspellDicts.en-science
  1508. pkgs.aspellDicts.en-computers
  1509. #+END_SRC
  1510. GNU Aspell[fn:57] 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.
  1511. #+NAME: emacs-aspell-elisp
  1512. #+BEGIN_SRC emacs-lisp
  1513. ;; Use `aspell' as a drop-in replacement for `ispell'.
  1514. (setq ispell-program-name "aspell"
  1515. ispell-eextra-args '("--sug-mode=fast"))
  1516. ;; Configure the built-in `flyspell-mode'.
  1517. (dotfiles/leader
  1518. "ts" '(flyspell-mode :which-key "Spelling"))
  1519. #+END_SRC
  1520. ** Hugo
  1521. #+NAME: emacs-hugo-extras
  1522. #+BEGIN_SRC nix
  1523. pkgs.hugo
  1524. #+END_SRC
  1525. Hugo[fn:58] is one of the most popular open-source static site generators.
  1526. #+NAME: emacs-hugo-package
  1527. #+BEGIN_SRC nix
  1528. epkgs.ox-hugo
  1529. #+END_SRC
  1530. Ox-Hugo[fn:59] is an Org-Mode[fn:49] exporter for Hugo[fn:58] compabile markdown. I post nonsense on my Personal Blog[fn:60], and share my notes on various textbooks, articles, and software Here[fn:61].
  1531. #+NAME: emacs-hugo-elisp
  1532. #+BEGIN_SRC emacs-lisp
  1533. ;; Configure `ox-hugo' as an `org-mode-export' backend.
  1534. (require 'ox-hugo)
  1535. ;; Capture templates.
  1536. ;; Personal blog post.
  1537. (add-to-list 'org-roam-capture-templates
  1538. '("p" "Post" plain (function org-roam-capture--get-point)
  1539. "%?"
  1540. :file-name "docs/posts/${slug}"
  1541. :unnarrowed t
  1542. :head
  1543. "
  1544. ,#+TITLE: ${title}
  1545. ,#+AUTHOR: Christopher James Hayward
  1546. ,#+DATE: %<%Y-%m-%d>
  1547. ,#+OPTIONS: num:nil todo:nil tasks:nil
  1548. ,#+EXPORT_FILE_NAME: ${slug}
  1549. ,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
  1550. ,#+HUGO_BASE_DIR: ../
  1551. ,#+HUGO_AUTO_SET_LASTMOD: t
  1552. ,#+HUGO_SECTION: posts
  1553. ,#+HUGO_DRAFT: true
  1554. "))
  1555. ;; Shared notes.
  1556. (add-to-list 'org-roam-capture-templates
  1557. '("n" "Notes" plain (function org-roam-capture--get-point)
  1558. "%?"
  1559. :file-name "docs/notes/${slug}"
  1560. :unnarrowed t
  1561. :head
  1562. "
  1563. ,#+TITLE: ${title}
  1564. ,#+AUTHOR: Christopher James Hayward
  1565. ,#+OPTIONS: num:nil todo:nil tasks:nil
  1566. ,#+EXPORT_FILE_NAME: ${slug}
  1567. ,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/
  1568. ,#+HUGO_BASE_DIR: ../
  1569. ,#+HUGO_AUTO_SET_LASTMOD: t
  1570. ,#+HUGO_SECTION: notes
  1571. ,#+HUGO_DRAFT: true
  1572. "))
  1573. #+END_SRC
  1574. ** Reveal
  1575. #+NAME: emacs-reveal-package
  1576. #+BEGIN_SRC nix
  1577. epkgs.ox-reveal
  1578. #+END_SRC
  1579. Reveal.js[fn:62] 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:62] are built on open web technologies. That means anything you can do on the web, you can do in your presentation. Ox Reveal[fn:63] is an Org Mode[fn:49] export backend.
  1580. #+NAME: emacs-reveal-elisp
  1581. #+BEGIN_SRC emacs-lisp
  1582. ;; Configure `ox-reveal' as an `org-mode-export' backend.
  1583. (require 'ox-reveal)
  1584. ;; Don't rely on any local software.
  1585. (setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js")
  1586. ;; Create a capture template.
  1587. (add-to-list 'org-roam-capture-templates
  1588. '("s" "Slides" plain (function org-roam-capture--get-point)
  1589. "%?"
  1590. :file-name "docs/slides/${slug}"
  1591. :unnarrowed t
  1592. :head
  1593. "
  1594. ,#+TITLE: ${title}
  1595. ,#+AUTHOR: Christopher James Hayward
  1596. ,#+EMAIL: chris@chrishayward.xyz
  1597. ,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
  1598. ,#+REVEAL_THEME: serif
  1599. ,#+EXPORT_FILE_NAME: ${slug}
  1600. ,#+OPTIONS: reveal_title_slide:nil
  1601. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1602. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1603. "))
  1604. #+END_SRC
  1605. ** Passwords
  1606. #+NAME: emacs-pass-extras
  1607. #+BEGIN_SRC nix
  1608. pkgs.pass
  1609. #+END_SRC
  1610. With Pass[fn:64], 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.
  1611. #+NAME: emacs-pass-package
  1612. #+BEGIN_SRC nix
  1613. epkgs.password-store
  1614. #+END_SRC
  1615. Configure keybindings for passwords behind =SPC p=:
  1616. | Key | Description |
  1617. |-----+---------------------|
  1618. | p | Copy a password |
  1619. | r | Rename a password |
  1620. | g | Generate a password |
  1621. #+NAME: emacs-pass-elisp
  1622. #+BEGIN_SRC emacs-lisp
  1623. ;; Set the path to the password store.
  1624. (setq password-store-dir (expand-file-name "~/.password-store"))
  1625. ;; Apply custom keybindings.
  1626. (dotfiles/leader
  1627. "p" '(:ignore t :which-key "Passwords")
  1628. "pp" '(password-store-copy :which-key "Copy")
  1629. "pr" '(password-store-rename :which-key "Rename")
  1630. "pg" '(password-store-generate :which-key "Generate"))
  1631. #+END_SRC
  1632. ** MU4E
  1633. #+NAME: emacs-mu4e-extras
  1634. #+BEGIN_SRC nix
  1635. pkgs.mu
  1636. pkgs.isync
  1637. #+END_SRC
  1638. #+NAME: emacs-mu4e-package
  1639. #+BEGIN_SRC nix
  1640. epkgs.mu4e-alert
  1641. #+END_SRC
  1642. #+NAME: emacs-mu4e-config
  1643. #+BEGIN_SRC nix
  1644. home.file.".mbsyncrc" = {
  1645. text = ''
  1646. IMAPStore xyz-remote
  1647. Host mail.chrishayward.xyz
  1648. User chris@chrishayward.xyz
  1649. PassCmd "pass chrishayward.xyz/chris"
  1650. SSLType IMAPS
  1651. MaildirStore xyz-local
  1652. Path ~/.cache/mail/
  1653. Inbox ~/.cache/mail/inbox
  1654. SubFolders Verbatim
  1655. Channel xyz
  1656. Far :xyz-remote:
  1657. Near :xyz-local:
  1658. Patterns * !Archives
  1659. Create Both
  1660. Expunge Both
  1661. SyncState *
  1662. '';
  1663. };
  1664. #+END_SRC
  1665. #+BEGIN_SRC sh
  1666. mbsync -a
  1667. mu init --maildir="~/.cache/mail" --my-address="chris@chrishayward.xyz"
  1668. mu index
  1669. #+END_SRC
  1670. #+NAME: emacs-mu4e-elisp
  1671. #+BEGIN_SRC emacs-lisp
  1672. ;; Add the `mu4e' shipped with `mu' to the load path.
  1673. (add-to-list 'load-path "/etc/profiles/per-user/chris/share/emacs/site-lisp/mu4e/")
  1674. (require 'mu4e)
  1675. ;; Confiugure `mu4e'.
  1676. (setq mu4e-maildir "~/.cache/mail"
  1677. mu4e-update-interval (* 5 60)
  1678. mu4e-get-mail-command "mbsync -a"
  1679. mu4e-compose-format-flowed t
  1680. mu4e-change-filenames-when-moving t
  1681. mu4e-compose-signature (concat "Chris Hayward\n"
  1682. "chris@chrishayward.xyz"))
  1683. ;; Sign all outbound email with GPG.
  1684. (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
  1685. (setq message-send-mail-function 'smtpmail-send-it
  1686. mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
  1687. ;; Setup `mu4e' accounts.
  1688. (setq mu4e-contexts
  1689. (list
  1690. ;; Main
  1691. ;; chris@chrishayward.xyz
  1692. (make-mu4e-context
  1693. :name "Main"
  1694. :match-func
  1695. (lambda (msg)
  1696. (when msg
  1697. (string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
  1698. :vars
  1699. '((user-full-name . "Christopher James Hayward")
  1700. (user-mail-address . "chris@chrishayward.xyz")
  1701. (smtpmail-smtp-server . "mail.chrishayward.xyz")
  1702. (smtpmail-smtp-service . 587)
  1703. (smtpmail-stream-type . starttls)))))
  1704. ;; Setup `mu4e-alert'.
  1705. (setq mu4e-alert-set-default-style 'libnotify)
  1706. (mu4e-alert-enable-notifications)
  1707. (mu4e-alert-enable-mode-line-display)
  1708. ;; Open the `mu4e' dashboard.
  1709. (dotfiles/leader
  1710. "m" '(mu4e :which-key "Mail"))
  1711. #+END_SRC
  1712. ** Projectile
  1713. #+NAME: emacs-projectile-package
  1714. #+BEGIN_SRC nix
  1715. epkgs.projectile
  1716. #+END_SRC
  1717. Projectile[fn:65] 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.
  1718. #+NAME: emacs-projectile-elisp
  1719. #+BEGIN_SRC emacs-lisp
  1720. ;; Configure the `projectile-project-search-path'.
  1721. (setq projectile-project-search-path '("~/.local/source"))
  1722. (projectile-mode +1)
  1723. #+END_SRC
  1724. ** LSP Mode
  1725. #+NAME: emacs-lsp-package
  1726. #+BEGIN_SRC nix
  1727. epkgs.lsp-mode
  1728. epkgs.lsp-ui
  1729. #+END_SRC
  1730. The Language Server Protocol (LSP)[fn:66] defines the protocol used between an Editor or IDE, and a language server that provides features like:
  1731. + Auto Complete
  1732. + Go To Defintion
  1733. + Find All References
  1734. #+NAME: emacs-lsp-elisp
  1735. #+BEGIN_SRC emacs-lisp
  1736. ;; Configure `lsp-mode'.
  1737. (setq lsp-idle-delay 0.5
  1738. lsp-prefer-flymake t)
  1739. ;; Configure `lsp-ui'.
  1740. (setq lsp-ui-doc-position 'at-point
  1741. lsp-ui-doc-delay 0.5)
  1742. #+END_SRC
  1743. ** Company Mode
  1744. #+NAME: emacs-company-package
  1745. #+BEGIN_SRC nix
  1746. epkgs.company
  1747. #+END_SRC
  1748. Company[fn:67] 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.
  1749. #+NAME: emacs-company-elisp
  1750. #+BEGIN_SRC emacs-lisp
  1751. ;; Configure `company-mode'.
  1752. (setq company-backend 'company-capf
  1753. lsp-completion-provider :capf)
  1754. ;; Enable it globally.
  1755. (global-company-mode +1)
  1756. #+END_SRC
  1757. ** Go Mode
  1758. #+NAME: emacs-golang-package
  1759. #+BEGIN_SRC nix
  1760. epkgs.go-mode
  1761. #+END_SRC
  1762. Go Mode[fn:68] is a major mode for editing Golang[fn:18] source code in GNU/Emacs[fn:2].
  1763. #+NAME: emacs-golang-elisp
  1764. #+BEGIN_SRC emacs-lisp
  1765. ;; Configure `go-mode' to work with `lsp-mode'.
  1766. (defun dotfiles/go-hook ()
  1767. (add-hook 'before-save-hook #'lsp-format-buffer t t)
  1768. (add-hook 'before-save-hook #'lsp-organize-imports t t))
  1769. ;; Configure a custom `before-save-hook'.
  1770. (add-hook 'go-mode-hook #'dotfiles/go-hook)
  1771. #+END_SRC
  1772. ** Python Mode
  1773. #+NAME: emacs-python-package
  1774. #+BEGIN_SRC nix
  1775. epkgs.pretty-mode
  1776. #+END_SRC
  1777. The built in Python Mode[fn:69] 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:66] server. These tools are included in the Development Shell[fn:17] for Python[fn:22].
  1778. #+NAME: emacs-python-elisp
  1779. #+BEGIN_SRC emacs-lisp
  1780. ;; Configure `pretty-mode' to work with `python-mode'.
  1781. (add-hook 'python-mode-hook
  1782. (lambda ()
  1783. (turn-on-pretty-mode)))
  1784. #+END_SRC
  1785. ** PlantUML
  1786. #+NAME: emacs-plantuml-extras
  1787. #+BEGIN_SRC nix
  1788. pkgs.plantuml
  1789. #+END_SRC
  1790. PlantUML[fn:70] is an open-source tool allowing users to create diagrams from a plain-text language. Besides various UML diagrams, PlantUML[fn:70] has support for various other software developmented related formats, as well as visualizations of =JSON= and =YAML= files.
  1791. #+NAME: emacs-plantuml-package
  1792. #+BEGIN_SRC nix
  1793. epkgs.plantuml-mode
  1794. #+END_SRC
  1795. PlantUML Mode[fn:71] is a major mode for editing PlantUML[fn:70] sources in GNU/Emacs[fn:2].
  1796. #+NAME: emacs-plantuml-elisp
  1797. #+BEGIN_SRC emacs-lisp
  1798. ;; Configure `plantuml-mode'.
  1799. (add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
  1800. (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t)))
  1801. (setq plantuml-default-exec-mode 'executable
  1802. org-plantuml-exec-mode 'plantuml)
  1803. #+END_SRC
  1804. ** Swiper
  1805. #+NAME: emacs-swiper-package
  1806. #+BEGIN_SRC nix
  1807. epkgs.ivy
  1808. epkgs.counsel
  1809. epkgs.ivy-rich
  1810. epkgs.ivy-posframe
  1811. epkgs.ivy-prescient
  1812. #+END_SRC
  1813. Ivy (Swiper)[fn:72] 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.
  1814. #+NAME: emacs-swiper-elisp
  1815. #+BEGIN_SRC emacs-lisp
  1816. ;; Configure `ivy'.
  1817. (setq counsel-linux-app-format-function
  1818. #'counsel-linux-app-format-function-name-only)
  1819. (ivy-mode +1)
  1820. (counsel-mode +1)
  1821. ;; Configure `ivy-rich'.
  1822. (ivy-rich-mode +1)
  1823. ;; Configure `ivy-posframe'.
  1824. (setq ivy-posframe-parameters '((parent-frame nil))
  1825. ivy-posframe-display-functions-alist '((t . ivy-posframe-display)))
  1826. (ivy-posframe-mode +1)
  1827. ;; Configure `ivy-prescient'.
  1828. (setq ivy-prescient-enable-filtering nil)
  1829. (ivy-prescient-mode +1)
  1830. #+END_SRC
  1831. ** Transparency
  1832. 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.
  1833. #+NAME: emacs-transparency-elisp
  1834. #+BEGIN_SRC emacs-lisp
  1835. ;; Configure the default frame transparency.
  1836. (set-frame-parameter (selected-frame) 'alpha '(95 . 95))
  1837. (add-to-list 'default-frame-alist '(alpha . (95 . 95)))
  1838. #+END_SRC
  1839. ** Doom Themes
  1840. #+NAME: emacs-doom-themes-package
  1841. #+BEGIN_SRC nix
  1842. epkgs.doom-themes
  1843. #+END_SRC
  1844. Doom Themes[fn:73] is a theme megapack for GNU/Emacs[fn:2], inspired by community favourites.
  1845. #+NAME: emacs-doom-themes-elisp
  1846. #+BEGIN_SRC emacs-lisp
  1847. ;; Include modern themes from `doom-themes'.
  1848. (setq doom-themes-enable-bold t
  1849. doom-themes-enable-italic t)
  1850. ;; Load the `doom-moonlight' theme.
  1851. (load-theme 'doom-moonlight t)
  1852. (doom-modeline-mode +1)
  1853. ;; Load a new theme with <SPC> t t.
  1854. (dotfiles/leader
  1855. "tt" '(counsel-load-theme :which-key "Theme"))
  1856. #+END_SRC
  1857. ** Doom Modeline
  1858. #+NAME: emacs-doom-modeline-package
  1859. #+BEGIN_SRC nix
  1860. epkgs.doom-modeline
  1861. #+END_SRC
  1862. Doom Modeline[fn:74] is a fancy and fast modeline inspired by minimalism design. It's integrated into Centaur Emacs, Doom Emacs, and Spacemacs.
  1863. #+NAME: emacs-doom-modeline-elisp
  1864. #+BEGIN_SRC emacs-lisp
  1865. ;; Add the `doom-modeline' after initialization.
  1866. (add-hook 'after-init-hook 'doom-modeline-mode)
  1867. (setq doom-modeline-height 16
  1868. doom-modeline-icon t)
  1869. #+END_SRC
  1870. * Footnotes
  1871. [fn:1] https://gnu.org
  1872. [fn:2] https://gnu.org/software/emacs/
  1873. [fn:3] https://literateprogramming.com/knuthweb.pdf
  1874. [fn:4] https://nixos.org/manual/nixos/stable
  1875. [fn:5] https://nixos.org/manual/nix/stable
  1876. [fn:6] https://nixos.org/manual/nixpkgs/stable
  1877. [fn:7] https://github.com/nix-community/home-manager
  1878. [fn:8] https://github.com/nix-community/emacs-overlay
  1879. [fn:9] https://github.com/nixos/nixos-hardware
  1880. [fn:10] https://github.com/t184256/nix-on-droid
  1881. [fn:11] https://qemu.org
  1882. [fn:12] https://github.com/ch11ng/exwm
  1883. [fn:13] https://evil.readthedocs.io/en/latest/overview.html
  1884. [fn:14] https://samsung.com/us/mobile/galaxy-s10/buy/
  1885. [fn:15] https://www.raspberrypi.org/products/raspberry-pi-4-model-b/
  1886. [fn:16] https://raspberrypi.org/products/raspberry-pi-400/
  1887. [fn:17] https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html
  1888. [fn:18] https://golang.org
  1889. [fn:19] https://grpc.io
  1890. [fn:20] https://iso.org/standard/74528.html
  1891. [fn:21] https://en.wikipedia.org/wiki/C++
  1892. [fn:22] https://python.org
  1893. [fn:23] https://x.org/wiki/
  1894. [fn:24] https://wayland.freedesktop.org
  1895. [fn:25] https://nixos.wiki/wiki/Flakes
  1896. [fn:26] https://nix-community.cachix.org
  1897. [fn:27] https://docker.org
  1898. [fn:28] https://en.wikipedia.org/wiki/Firefox
  1899. [fn:29] https://jellyfin.org
  1900. [fn:30] https://moonlight-stream.org
  1901. [fn:31] https://teamviewer.com
  1902. [fn:32] https://git-scm.com
  1903. [fn:33] https://emacswiki.org/emacs/LearnEmacsLisp
  1904. [fn:34] https://neovim.io
  1905. [fn:35] https://gtk.org
  1906. [fn:36] https://github.com/nixos/nix-mode
  1907. [fn:37] https://github.com/noctuid/general.el
  1908. [fn:38] https://github.com/justbur/emacs-which-key
  1909. [fn:39] https://emacswiki.org/emacs/eww
  1910. [fn:40] https://emacswiki.org/emacs/DiredMode
  1911. [fn:41] https://emacswiki.org/emacs/DiredExtra#Dired_X
  1912. [fn:42] https://github.com/domtronn/all-the-icons.el
  1913. [fn:43] https://github.com/iqbalansari/emacs-emojify
  1914. [fn:44] https://gnu.org/software/emacs/manual/html_mono/eshell.html
  1915. [fn:45] https://github.com/akermu/emacs-libvterm
  1916. [fn:46] https://github.com/neovim/libvterm
  1917. [fn:47] https://magit.vc
  1918. [fn:48] https://github.com/skeeto/elfeed
  1919. [fn:49] https://orgmode.org
  1920. [fn:50] https://github.com/org-roam/org-roam
  1921. [fn:51] https://zettelkasten.de
  1922. [fn:52] https://github.com/org-roam/org-roam-server
  1923. [fn:53] https://orgmode.org/worg/org-contrib/org-drill.html
  1924. [fn:54] https://marcinkoziej/org-pomodoro
  1925. [fn:55] https://en.wikipedia.org/wiki/Pomodoro_Technique
  1926. [fn:56] https://github.com/bnbeckwith/writegood-mode
  1927. [fn:57] https://aspell.net
  1928. [fn:58] https://gohugo.io
  1929. [fn:59] https://oxhugo.scripter.co
  1930. [fn:60] https://chrishayward.xyz/posts/
  1931. [fn:61] https://chrishayward.xyz/notes/
  1932. [fn:62] https://revealjs.com
  1933. [fn:63] https://github.com/hexmode/ox-reveal
  1934. [fn:64] https://password-store.org
  1935. [fn:65] https://projectile.mx
  1936. [fn:66] https://microsoft.github.io/language-server-protocol
  1937. [fn:67] https://company-mode.github.io
  1938. [fn:68] https://emacswiki.org/emacs/GoMode
  1939. [fn:69] https://emacswiki.org/emacs/PythonProgrammingInEmacs
  1940. [fn:70] https://plantuml.com
  1941. [fn:71] https://github.com/skuro/plantuml-mode
  1942. [fn:72] https://github.com/abo-abo/swiper
  1943. [fn:73] https://github.com/hlissner/emacs-doom-themes
  1944. [fn:74] https://github.com/seagle0128/doom-modeline
  1945. [fn:75] https://laptopmedia.com/laptop-specs/acer-nitro-5-an515-53-2