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.

2555 lines
74 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
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. + boot :: Build the new configuration and make it the boot default, without activation
  34. + test :: Build and activate the new configuration, without adding it to the boot menu
  35. + switch :: Build and activate the new configuration, making it the new boot default
  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-rustic-package>>
  860. <<emacs-plantuml-package>>
  861. <<emacs-swiper-package>>
  862. <<emacs-desktop-package>>
  863. <<emacs-doom-themes-package>>
  864. <<emacs-doom-modeline-package>>
  865. ];
  866. };
  867. in {
  868. home.packages = [
  869. <<emacs-exwm-extras>>
  870. <<emacs-hugo-extras>>
  871. <<emacs-pass-extras>>
  872. <<emacs-mu4e-extras>>
  873. <<emacs-aspell-extras>>
  874. <<emacs-desktop-extras>>
  875. <<emacs-plantuml-extras>>
  876. <<emacs-nix-mode-extras>>
  877. ];
  878. programs.emacs = {
  879. enable = true;
  880. package = myEmacs;
  881. };
  882. <<emacs-exwm-config>>
  883. <<emacs-exwm-xinitrc>>
  884. <<emacs-mu4e-config>>
  885. }
  886. #+END_SRC
  887. 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.
  888. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/init.el
  889. ;; <<file-warning>>
  890. ;; Required inputs.
  891. <<emacs-exwm-elisp>>
  892. <<emacs-evil-elisp>>
  893. <<emacs-general-elisp>>
  894. <<emacs-which-key-elisp>>
  895. ;; Optional inputs.
  896. <<emacs-org-elisp>>
  897. <<emacs-org-roam-elisp>>
  898. <<emacs-org-drill-elisp>>
  899. <<emacs-org-agenda-elisp>>
  900. <<emacs-pomodoro-elisp>>
  901. <<emacs-writegood-elisp>>
  902. <<emacs-aspell-elisp>>
  903. <<emacs-eww-elisp>>
  904. <<emacs-hugo-elisp>>
  905. <<emacs-reveal-elisp>>
  906. <<emacs-pass-elisp>>
  907. <<emacs-mu4e-elisp>>
  908. <<emacs-dired-elisp>>
  909. <<emacs-icons-elisp>>
  910. <<emacs-emoji-elisp>>
  911. <<emacs-eshell-elisp>>
  912. <<emacs-vterm-elisp>>
  913. <<emacs-magit-elisp>>
  914. <<emacs-fonts-elisp>>
  915. <<emacs-elfeed-elisp>>
  916. <<emacs-projectile-elisp>>
  917. <<emacs-lsp-elisp>>
  918. <<emacs-company-elisp>>
  919. <<emacs-golang-elisp>>
  920. <<emacs-python-elisp>>
  921. <<emacs-rustic-elisp>>
  922. <<emacs-plantuml-elisp>>
  923. <<emacs-desktop-elisp>>
  924. ;; User interface.
  925. <<emacs-swiper-elisp>>
  926. <<emacs-transparency-elisp>>
  927. <<emacs-doom-themes-elisp>>
  928. <<emacs-doom-modeline-elisp>>
  929. #+END_SRC
  930. 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=.
  931. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/early-init.el
  932. ;; <<file-warning>>
  933. <<emacs-disable-ui-elisp>>
  934. <<emacs-native-comp-elisp>>
  935. <<emacs-backup-files-elisp>>
  936. <<emacs-shell-commands-elisp>>
  937. #+END_SRC
  938. ** Disable UI
  939. 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.
  940. #+NAME: emacs-disable-ui-elisp
  941. #+BEGIN_SRC emacs-lisp
  942. ;; Disable unwanted UI elements.
  943. (tooltip-mode -1)
  944. (menu-bar-mode -1)
  945. (tool-bar-mode -1)
  946. (scroll-bar-mode -1)
  947. ;; Fix the scrolling behaviour.
  948. (setq scroll-conservatively 101)
  949. ;; Fix mouse-wheel scrolling behaviour.
  950. (setq mouse-wheel-follow-mouse t
  951. mouse-wheel-progressive-speed t
  952. mouse-wheel-scroll-amount '(3 ((shift) . 3)))
  953. #+END_SRC
  954. ** Native Comp
  955. #+NAME: emacs-native-comp-package
  956. #+BEGIN_SRC nix
  957. pkgs.emacsGcc;
  958. #+END_SRC
  959. 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.
  960. #+NAME: emacs-native-comp-elisp
  961. #+BEGIN_SRC emacs-lisp
  962. ;; Silence warnings from packages that don't support `native-comp'.
  963. (setq comp-async-report-warnings-errors nil ;; Emacs 27.2 ...
  964. native-comp-async-report-warnings-errors nil) ;; Emacs 28+ ...
  965. #+END_SRC
  966. ** Backup Files
  967. 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.
  968. #+NAME: emacs-backup-files-elisp
  969. #+BEGIN_SRC emacs-lisp
  970. ;; Disable unwanted features.
  971. (setq make-backup-files nil
  972. create-lockfiles nil)
  973. #+END_SRC
  974. ** Shell Commands
  975. Define some methods for interaction between GNU/Emacs[fn:2], and the systems underyling shell:
  976. 1) Method to run an external process, launching any application on a new process without interferring with Emacs[fn:2]
  977. 2) Method to apply commands to the curren call process, effecting the running instance of Emacs[fn:2]
  978. #+NAME: emacs-shell-commands-elisp
  979. #+BEGIN_SRC emacs-lisp
  980. ;; Define a method to run an external process.
  981. (defun dotfiles/run (cmd)
  982. "Run an external process."
  983. (interactive (list (read-shell-command "λ ")))
  984. (start-process-shell-command cmd nil cmd))
  985. ;; Define a method to run a background process.
  986. (defun dotfiles/run-in-background (cmd)
  987. (let ((command-parts (split-string cmd "[ ]+")))
  988. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  989. #+END_SRC
  990. ** Nix Mode
  991. #+NAME: emacs-nix-mode-extras
  992. #+BEGIN_SRC nix
  993. pkgs.nixfmt
  994. #+END_SRC
  995. 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.
  996. #+NAME: emacs-nix-mode-package
  997. #+BEGIN_SRC nix
  998. epkgs.nix-mode
  999. #+END_SRC
  1000. ** Evil Mode
  1001. 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.
  1002. #+NAME: emacs-evil-package
  1003. #+BEGIN_SRC nix
  1004. epkgs.evil
  1005. epkgs.evil-collection
  1006. epkgs.evil-surround
  1007. epkgs.evil-nerd-commenter
  1008. #+END_SRC
  1009. 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].
  1010. #+NAME: emacs-evil-elisp
  1011. #+BEGIN_SRC emacs-lisp
  1012. ;; Enable the Extensible VI Layer for Emacs.
  1013. (setq evil-want-integration t ;; Required for `evil-collection.'
  1014. evil-want-keybinding nil) ;; Same as above.
  1015. (evil-mode +1)
  1016. ;; Configure `evil-collection'.
  1017. (evil-collection-init)
  1018. ;; Configure `evil-surround'.
  1019. (global-evil-surround-mode +1)
  1020. ;; Configure `evil-nerd-commenter'.
  1021. (global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
  1022. #+END_SRC
  1023. ** EXWM
  1024. #+NAME: emacs-exwm-package
  1025. #+BEGIN_SRC nix
  1026. epkgs.exwm
  1027. #+END_SRC
  1028. 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:
  1029. + Fully keyboard-driven operations
  1030. + Hybrid layout modes (tiling & stacking)
  1031. + Dynamic workspace support
  1032. + ICCM/EWMH compliance
  1033. #+NAME: emacs-exwm-extras
  1034. #+BEGIN_SRC nix
  1035. pkgs.nitrogen
  1036. pkgs.autorandr
  1037. #+END_SRC
  1038. 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].
  1039. #+NAME: emacs-exwm-config
  1040. #+BEGIN_SRC nix
  1041. xsession = {
  1042. enable = true;
  1043. windowManager.command = ''
  1044. ${pkgs.nitrogen}/bin/nitrogen --restore
  1045. ${myEmacs}/bin/emacs --daemon -f exwm-enable
  1046. ${myEmacs}/bin/emacsclient -c
  1047. '';
  1048. };
  1049. #+END_SRC
  1050. 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=.
  1051. #+NAME: emacs-exwm-xinitrc
  1052. #+BEGIN_SRC nix
  1053. home.file.".xinitrc" = {
  1054. text = ''
  1055. exec ./.xsession
  1056. '';
  1057. };
  1058. #+END_SRC
  1059. #+NAME: emacs-exwm-elisp
  1060. #+BEGIN_SRC emacs-lisp
  1061. ;; Configure `exwm'.
  1062. (setq exwm-worspace-show-all-buffers t)
  1063. (setq exwm-input-prefix-keys
  1064. '(?\M-x
  1065. ?\C-g
  1066. ?\C-\ ))
  1067. (setq exwm-input-global-keys
  1068. `(([?\s-r] . exwm-reset)
  1069. ,@(mapcar (lambda (i)
  1070. `(,(kbd (format "s-%d" i)) .
  1071. (lambda ()
  1072. (interactive)
  1073. (exwm-workspace-switch-create ,i))))
  1074. (number-sequence 1 9))))
  1075. ;; Configure `exwm-randr'.
  1076. (require 'exwm-randr)
  1077. (exwm-randr-enable)
  1078. ;; Configure custom hooks.
  1079. (setq display-time-and-date t)
  1080. (add-hook 'exwm-init-hook
  1081. (lambda ()
  1082. (display-battery-mode +1) ;; Display battery info (if available).
  1083. (display-time-mode +1))) ;; Display the time in the modeline.
  1084. ;; Setup buffer display names.
  1085. (add-hook 'exwm-update-class-hook
  1086. (lambda ()
  1087. (exwm-workspace-rename-buffer exwm-class-name))) ;; Use the system class name.
  1088. ;; Configure monitor hot-swapping.
  1089. (add-hook 'exwm-randr-screen-change-hook
  1090. (lambda ()
  1091. (dotfiles/run-in-background "autorandr --change --force"))) ;; Swap to the next screen config.
  1092. #+END_SRC
  1093. ** General
  1094. #+NAME: emacs-general-package
  1095. #+BEGIN_SRC nix
  1096. epkgs.general
  1097. #+END_SRC
  1098. 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.
  1099. #+NAME: emacs-general-elisp
  1100. #+BEGIN_SRC emacs-lisp
  1101. ;; Use <SPC> as a leader key via `general.el'.
  1102. (general-create-definer dotfiles/leader
  1103. :states '(normal motion)
  1104. :keymaps 'override
  1105. :prefix "SPC"
  1106. :global-prefix "C-SPC")
  1107. ;; Find files with <SPC> <period> ...
  1108. ;; Switch buffers with <SPC> <comma> ...
  1109. (dotfiles/leader
  1110. "." '(find-file :which-key "File")
  1111. "," '(switch-to-buffer :which-key "Buffer")
  1112. "c" '(kill-buffer-and-window :which-key "Close"))
  1113. ;; Add keybindings for executing shell commands.
  1114. (dotfiles/leader
  1115. "r" '(:ignore t :which-key "Run")
  1116. "rr" '(dotfiles/run :which-key "Run")
  1117. "ra" '(async-shell-command :which-key "Async"))
  1118. ;; Add keybindings for quitting Emacs.
  1119. (dotfiles/leader
  1120. "q" '(:ignore t :which-key "Quit")
  1121. "qq" '(save-buffers-kill-emacs :which-key "Save")
  1122. "qw" '(kill-emacs :which-key "Now")
  1123. "qf" '(delete-frame :which-key "Frame"))
  1124. ;; Add keybindings for toggles / tweaks.
  1125. (dotfiles/leader
  1126. "t" '(:ignore t :which-key "Toggle / Tweak"))
  1127. ;; Add keybindings for working with frames to replace
  1128. ;; the C-x <num> <num> method of bindings, which is awful.
  1129. (dotfiles/leader
  1130. "w" '(:ignore t :which-key "Windows")
  1131. "ww" '(window-swap-states :which-key "Swap")
  1132. "wc" '(delete-window :which-key "Close")
  1133. "wh" '(windmove-left :which-key "Left")
  1134. "wj" '(windmove-down :which-key "Down")
  1135. "wk" '(windmove-up :which-key "Up")
  1136. "wl" '(windmove-right :which-key "Right")
  1137. "ws" '(:ignore t :which-key "Split")
  1138. "wsj" '(split-window-below :which-key "Below")
  1139. "wsl" '(split-window-right :which-key "Right"))
  1140. #+END_SRC
  1141. ** Which Key
  1142. 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.
  1143. #+NAME: emacs-which-key-package
  1144. #+BEGIN_SRC nix
  1145. epkgs.which-key
  1146. #+END_SRC
  1147. #+NAME: emacs-which-key-elisp
  1148. #+BEGIN_SRC emacs-lisp
  1149. ;; Configure `which-key' to see keyboard bindings in the
  1150. ;; mini-buffer and when using M-x.
  1151. (setq which-key-idle-delay 0.0)
  1152. (which-key-mode +1)
  1153. #+END_SRC
  1154. ** EWW
  1155. 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.
  1156. + Use ~eww~ as the default browser
  1157. + Don't use any special fonts or colours
  1158. #+NAME: emacs-eww-elisp
  1159. #+BEGIN_SRC emacs-lisp
  1160. ;; Set `eww' as the default browser.
  1161. (setq browse-url-browser-function 'eww-browse-url)
  1162. ;; Configure the `shr' rendering engine.
  1163. (setq shr-use-fonts nil
  1164. shr-use-colors nil)
  1165. #+END_SRC
  1166. ** Dired
  1167. #+NAME: emacs-dired-package
  1168. #+BEGIN_SRC nix
  1169. epkgs.dired-single
  1170. #+END_SRC
  1171. 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].
  1172. #+NAME: emacs-dired-elisp
  1173. #+BEGIN_SRC emacs-lisp
  1174. ;; Include `dired-x' for the `jump' method.
  1175. (require 'dired-x)
  1176. ;; Configure `dired-single' to support `evil' keys.
  1177. (evil-collection-define-key 'normal 'dired-mode-map
  1178. "h" 'dired-single-up-directory
  1179. "l" 'dired-single-buffer)
  1180. ;; Setup `all-the-icons' and the `dired' extension.
  1181. ;; Configure keybindings for `dired'.
  1182. (dotfiles/leader
  1183. "d" '(dired-jump :which-key "Dired"))
  1184. #+END_SRC
  1185. ** Icons
  1186. #+NAME: emacs-icons-package
  1187. #+BEGIN_SRC nix
  1188. epkgs.all-the-icons
  1189. epkgs.all-the-icons-dired
  1190. #+END_SRC
  1191. All The Icons[fn:42] is a utility package to collect various Icon Fonts and prioritize them within GNU/Emacs[fn:2].
  1192. #+NAME: emacs-icons-elisp
  1193. #+BEGIN_SRC emacs-lisp
  1194. ;; Setup `all-the-icons-dired'.
  1195. (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
  1196. ;; Display default font ligatures.
  1197. (global-prettify-symbols-mode +1)
  1198. #+END_SRC
  1199. ** Emojis
  1200. #+NAME: emacs-emoji-package
  1201. #+BEGIN_SRC nix
  1202. epkgs.emojify
  1203. #+END_SRC
  1204. 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.
  1205. #+NAME: emacs-emoji-elisp
  1206. #+BEGIN_SRC emacs-lisp
  1207. ;; Setup `emojify'.
  1208. (add-hook 'after-init-hook 'global-emojify-mode)
  1209. #+END_SRC
  1210. ** EShell
  1211. #+NAME: emacs-eshell-package
  1212. #+BEGIN_SRC nix
  1213. epkgs.eshell-prompt-extras
  1214. #+END_SRC
  1215. 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].
  1216. #+NAME: emacs-eshell-elisp
  1217. #+BEGIN_SRC emacs-lisp
  1218. ;; Configure `eshell'.
  1219. (setq eshell-highlight-prompt nil
  1220. eshell-prefer-lisp-functions nil)
  1221. ;; Configure the lambda prompt.
  1222. (autoload 'epe-theme-lambda "eshell-prompt-extras")
  1223. (setq eshell-prompt-function 'epe-theme-lambda)
  1224. ;; Configure keybindings for `eshell'.
  1225. (dotfiles/leader
  1226. "e" '(eshell :which-key "EShell"))
  1227. #+END_SRC
  1228. ** VTerm
  1229. 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.
  1230. #+NAME: emacs-vterm-package
  1231. #+BEGIN_SRC nix
  1232. epkgs.vterm
  1233. #+END_SRC
  1234. #+NAME: emacs-vterm-elisp
  1235. #+BEGIN_SRC emacs-lisp
  1236. ;; Add keybindings for interacting with the shell(s).
  1237. (dotfiles/leader
  1238. "v" '(vterm :which-key "VTerm"))
  1239. #+END_SRC
  1240. ** Magit
  1241. 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.
  1242. #+NAME: emacs-magit-package
  1243. #+BEGIN_SRC nix
  1244. epkgs.magit
  1245. #+END_SRC
  1246. | Key | Description |
  1247. |-----+--------------------------------------|
  1248. | gg | Check the status of a repository |
  1249. | gc | Clone a remote repository |
  1250. | gf | Fetch the contents of the repository |
  1251. | gp | Pull the remotes of the repository |
  1252. #+NAME: emacs-magit-elisp
  1253. #+BEGIN_SRC emacs-lisp
  1254. ;; Add keybindings for working with `magit'.
  1255. (dotfiles/leader
  1256. "g" '(:ignore t :which-key "Git")
  1257. "gg" '(magit-status :which-key "Status")
  1258. "gc" '(magit-clone :which-key "Clone")
  1259. "gf" '(magit-fetch :which-key "Fetch")
  1260. "gp" '(magit-pull :which-key "Pull"))
  1261. #+END_SRC
  1262. ** Fonts
  1263. #+NAME: emacs-fonts-package
  1264. #+BEGIN_SRC nix
  1265. epkgs.hydra
  1266. #+END_SRC
  1267. #+NAME: emacs-fonts-elisp
  1268. #+BEGIN_SRC emacs-lisp
  1269. ;; Configure the font when running as `emacs-server'.
  1270. (custom-set-faces
  1271. '(default ((t (:inherit nil :height 96 :family "Iosevka")))))
  1272. ;; Set all three of Emacs' font faces.
  1273. ;; NOTE: This only works without `emacs-server'.
  1274. ;; (set-face-attribute 'default nil :font "Iosevka" :height 96)
  1275. ;; (set-face-attribute 'fixed-pitch nil :font "Iosevka" :height 96)
  1276. ;; (set-face-attribute 'variable-pitch nil :font "Iosevka" :height 96)
  1277. ;; Define a `hydra' function for scaling the text interactively.
  1278. (defhydra hydra-text-scale (:timeout 4)
  1279. "Scale text"
  1280. ("j" text-scale-decrease "Decrease")
  1281. ("k" text-scale-increase "Increase")
  1282. ("f" nil "Finished" :exit t))
  1283. ;; Create keybinding for calling the function.
  1284. (dotfiles/leader
  1285. "tf" '(hydra-text-scale/body :which-key "Font"))
  1286. #+END_SRC
  1287. ** Elfeed
  1288. #+NAME: emacs-elfeed-package
  1289. #+BEGIN_SRC nix
  1290. epkgs.elfeed
  1291. #+END_SRC
  1292. 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.
  1293. | Key | Command |
  1294. |-----+---------|
  1295. | l | Open |
  1296. | u | Update |
  1297. #+NAME: emacs-elfeed-elisp
  1298. #+BEGIN_SRC emacs-lisp
  1299. ;; Add custom feeds for `elfeed' to fetch.
  1300. (setq elfeed-feeds (quote
  1301. (("https://hexdsl.co.uk/rss.xml")
  1302. ("https://lukesmith.xyz/rss.xml")
  1303. ("https://friendo.monster/rss.xml")
  1304. ("https://chrishayward.xyz/index.xml")
  1305. ("https://protesilaos.com/codelog.xml"))))
  1306. ;; Add custom keybindings for `elfeed'.
  1307. (dotfiles/leader
  1308. "l" '(:ignore t :which-key "Elfeed")
  1309. "ll" '(elfeed :which-key "Open")
  1310. "lu" '(elfeed-update :which-key "Update"))
  1311. #+END_SRC
  1312. ** Org Mode
  1313. #+NAME: emacs-org-package
  1314. #+BEGIN_SRC nix
  1315. epkgs.org
  1316. #+END_SRC
  1317. 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.
  1318. #+NAME: emacs-org-elisp
  1319. #+BEGIN_SRC emacs-lisp
  1320. ;; Configure `org-mode' source blocks.
  1321. (setq org-src-fontify-natively t ;; Make source blocks prettier.
  1322. org-src-tab-acts-natively t ;; Use TAB indents within source blocks.
  1323. org-src-preserve-indentation t) ;; Stop `org-mode' from formatting blocks.
  1324. ;; Add an `org-mode-hook'.
  1325. (add-hook 'org-mode-hook
  1326. (lambda ()
  1327. (org-indent-mode)
  1328. (visual-line-mode)))
  1329. ;; Remove the `Validate XHTML 1.0' message from HTML export.
  1330. (setq org-export-html-validation-link nil
  1331. org-html-validation-link nil)
  1332. ;; TODO: Configure default structure templates.
  1333. ;; (require 'org-tempo)
  1334. ;; Apply custom keybindings.
  1335. (dotfiles/leader
  1336. "o" '(:ignore t :which-key "Org")
  1337. "oe" '(org-export-dispatch :which-key "Export")
  1338. "ot" '(org-babel-tangle :which-key "Tangle")
  1339. "oi" '(org-toggle-inline-images :which-key "Images")
  1340. "of" '(:ignore t :which-key "Footnotes")
  1341. "ofn" '(org-footnote-normalize :which-key "Normalize"))
  1342. #+END_SRC
  1343. ** Org Roam
  1344. #+NAME: emacs-org-roam-package
  1345. #+BEGIN_SRC nix
  1346. epkgs.org-roam
  1347. epkgs.org-roam-server
  1348. #+END_SRC
  1349. 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.
  1350. #+NAME: emacs-org-roam-elisp
  1351. #+BEGIN_SRC emacs-lisp
  1352. ;; Setup `org-roam' hooks.
  1353. (add-hook 'after-init-hook
  1354. (lambda ()
  1355. (org-roam-mode)
  1356. (org-roam-server-mode)))
  1357. ;; Configure `org-roam'.
  1358. (setq org-roam-encrypt-files t
  1359. org-roam-directory (expand-file-name "/etc/dotfiles")
  1360. org-roam-capture-templates '()
  1361. org-roam-dailies-capture-templates '())
  1362. ;; Encrypt files with the public key.
  1363. (setq epa-file-select-keys 2
  1364. epa-file-encrypt-to "37AB1CB72B741E478CA026D43025DCBD46F81C0F"
  1365. epa-cache-passphrase-for-symmetric-encryption t)
  1366. ;; Define a new `title-to-slug' function to override the default `org-roam-title-to-slug' function.
  1367. ;; This is done to change the replacement character from "_" to "-".
  1368. (require 'cl-lib)
  1369. (defun dotfiles/title-to-slug (title)
  1370. "Convert TITLE to a filename-suitable slug."
  1371. (cl-flet* ((nonspacing-mark-p (char)
  1372. (eq 'Mn (get-char-code-property char 'general-category)))
  1373. (strip-nonspacing-marks (s)
  1374. (apply #'string (seq-remove #'nonspacing-mark-p
  1375. (ucs-normalize-NFD-string s))))
  1376. (cl-replace (title pair)
  1377. (replace-regexp-in-string (car pair) (cdr pair) title)))
  1378. (let* ((pairs `(("[^[:alnum:][:digit:]]" . "-") ;; Convert anything not alphanumeric.
  1379. ("--*" . "-") ;; Remove sequential dashes.
  1380. ("^-" . "") ;; Remove starting dashes.
  1381. ("-$" . ""))) ;; Remove ending dashes.
  1382. (slug (-reduce-from #'cl-replace (strip-nonspacing-marks title) pairs)))
  1383. (downcase slug))))
  1384. (setq org-roam-title-to-slug-function #'dotfiles/title-to-slug)
  1385. ;; Configure capture templates.
  1386. ;; Standard document.
  1387. (add-to-list 'org-roam-capture-templates
  1388. '("d" "Default" entry (function org-roam-capture--get-point)
  1389. "%?"
  1390. :file-name "docs/${slug}"
  1391. :unnarrowed t
  1392. :head
  1393. "
  1394. ,#+TITLE: ${title}
  1395. ,#+AUTHOR: Christopher James Hayward
  1396. ,#+EMAIL: chris@chrishayward.xyz
  1397. "))
  1398. ;; Course document.
  1399. (add-to-list 'org-roam-capture-templates
  1400. '("c" "Course" plain (function org-roam-capture--get-point)
  1401. "%?"
  1402. :file-name "docs/courses/${slug}"
  1403. :unnarrowed t
  1404. :head
  1405. "
  1406. ,#+TITLE: ${title}
  1407. ,#+SUBTITLE:
  1408. ,#+AUTHOR: Christopher James Hayward
  1409. ,#+EMAIL: chris@chrishayward.xyz
  1410. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1411. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1412. "))
  1413. ;; Daily notes.
  1414. (add-to-list 'org-roam-dailies-capture-templates
  1415. '("d" "Default" entry (function org-roam-capture--get-point)
  1416. "* %?"
  1417. :file-name "docs/daily/%<%Y-%m-%d>"
  1418. :head
  1419. "
  1420. ,#+TITLE: %<%Y-%m-%d>
  1421. ,#+AUTHOR: Christopher James Hayward
  1422. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1423. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1424. "))
  1425. ;; Apply custom keybindings.
  1426. (dotfiles/leader
  1427. "or" '(:ignore t :which-key "Roam")
  1428. "ori" '(org-roam-insert :which-key "Insert")
  1429. "orf" '(org-roam-find-file :which-key "Find")
  1430. "orc" '(org-roam-capture :which-key "Capture")
  1431. "orb" '(org-roam-buffer-toggle-display :which-key "Buffer"))
  1432. ;; Apply custom keybindings for dailies.
  1433. (dotfiles/leader
  1434. "ord" '(:ignore t :which-key "Dailies")
  1435. "ordd" '(org-roam-dailies-find-date :which-key "Date")
  1436. "ordt" '(org-roam-dailies-find-today :which-key "Today")
  1437. "ordm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
  1438. "ordy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
  1439. #+END_SRC
  1440. ** Org Drill
  1441. #+NAME: emacs-org-drill-package
  1442. #+BEGIN_SRC nix
  1443. epkgs.org-drill
  1444. #+END_SRC
  1445. 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.
  1446. #+NAME: emacs-org-drill-elisp
  1447. #+BEGIN_SRC emacs-lisp
  1448. ;; Configure keybindings for `org-drill'.
  1449. (dotfiles/leader
  1450. "od" '(:ignore t :which-key "Drill")
  1451. "odd" '(org-drill :which-key "Drill")
  1452. "odc" '(org-drill-cram :which-key "Cram")
  1453. "odr" '(org-drill-resume :which-key "Resume"))
  1454. #+END_SRC
  1455. ** Org Agenda
  1456. 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.
  1457. #+NAME: emacs-org-agenda-elisp
  1458. #+BEGIN_SRC emacs-lisp
  1459. ;; Configure `org-agenda' to use the project files.
  1460. (setq org-agenda-files '("/etc/dotfiles/"
  1461. "/etc/dotfiles/docs/"
  1462. "/etc/dotfiles/docs/courses/"
  1463. "/etc/dotfiles/docs/daily/"
  1464. "/etc/dotfiles/docs/notes/"
  1465. "/etc/dotfiles/docs/posts/"
  1466. "/etc/dotfiles/docs/slides/"))
  1467. ;; Include files encrypted with `gpg'.
  1468. (require 'org)
  1469. (unless (string-match-p "\\.gpg" org-agenda-file-regexp)
  1470. (setq org-agenda-file-regexp
  1471. (replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?"
  1472. org-agenda-file-regexp)))
  1473. ;; Open an agenda buffer with SPC o a.
  1474. (dotfiles/leader
  1475. "oa" '(org-agenda :which-key "Agenda"))
  1476. #+END_SRC
  1477. ** Org Pomodoro
  1478. #+NAME: emacs-pomodoro-package
  1479. #+BEGIN_SRC nix
  1480. epkgs.org-pomodoro
  1481. #+END_SRC
  1482. 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.
  1483. #+NAME: emacs-pomodoro-elisp
  1484. #+BEGIN_SRC emacs-lisp
  1485. ;; Configure `org-pomodor' with the overtime workflow.
  1486. (setq org-pomodoro-manual-break t
  1487. org-pomodoro-keep-killed-time t)
  1488. ;; Configure keybindings.
  1489. (dotfiles/leader
  1490. "op" '(org-pomodoro :which-key "Pomodoro"))
  1491. #+END_SRC
  1492. ** Writegood Mode
  1493. #+NAME: emacs-writegood-package
  1494. #+BEGIN_SRC nix
  1495. epkgs.writegood-mode
  1496. #+END_SRC
  1497. 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:
  1498. + Weasel Words
  1499. + Passive Voice
  1500. + Duplicate Words
  1501. #+NAME: emacs-writegood-elisp
  1502. #+BEGIN_SRC emacs-lisp
  1503. ;; Configure `writegood-mode'.
  1504. (dotfiles/leader
  1505. "tg" '(writegood-mode :which-key "Grammar"))
  1506. #+END_SRC
  1507. ** Aspell
  1508. #+NAME: emacs-aspell-extras
  1509. #+BEGIN_SRC nix
  1510. pkgs.aspell
  1511. pkgs.aspellDicts.en
  1512. pkgs.aspellDicts.en-science
  1513. pkgs.aspellDicts.en-computers
  1514. #+END_SRC
  1515. 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.
  1516. #+NAME: emacs-aspell-elisp
  1517. #+BEGIN_SRC emacs-lisp
  1518. ;; Use `aspell' as a drop-in replacement for `ispell'.
  1519. (setq ispell-program-name "aspell"
  1520. ispell-eextra-args '("--sug-mode=fast"))
  1521. ;; Configure the built-in `flyspell-mode'.
  1522. (dotfiles/leader
  1523. "ts" '(flyspell-mode :which-key "Spelling"))
  1524. #+END_SRC
  1525. ** Hugo
  1526. #+NAME: emacs-hugo-extras
  1527. #+BEGIN_SRC nix
  1528. pkgs.hugo
  1529. #+END_SRC
  1530. Hugo[fn:58] is one of the most popular open-source static site generators.
  1531. #+NAME: emacs-hugo-package
  1532. #+BEGIN_SRC nix
  1533. epkgs.ox-hugo
  1534. #+END_SRC
  1535. 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].
  1536. #+NAME: emacs-hugo-elisp
  1537. #+BEGIN_SRC emacs-lisp
  1538. ;; Configure `ox-hugo' as an `org-mode-export' backend.
  1539. (require 'ox-hugo)
  1540. ;; Capture templates.
  1541. ;; Personal blog post.
  1542. (add-to-list 'org-roam-capture-templates
  1543. '("p" "Post" plain (function org-roam-capture--get-point)
  1544. "%?"
  1545. :file-name "docs/posts/${slug}"
  1546. :unnarrowed t
  1547. :head
  1548. "
  1549. ,#+TITLE: ${title}
  1550. ,#+AUTHOR: Christopher James Hayward
  1551. ,#+DATE: %<%Y-%m-%d>
  1552. ,#+OPTIONS: num:nil todo:nil tasks:nil
  1553. ,#+EXPORT_FILE_NAME: ${slug}
  1554. ,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
  1555. ,#+HUGO_BASE_DIR: ../
  1556. ,#+HUGO_AUTO_SET_LASTMOD: t
  1557. ,#+HUGO_SECTION: posts
  1558. ,#+HUGO_DRAFT: true
  1559. "))
  1560. ;; Shared notes.
  1561. (add-to-list 'org-roam-capture-templates
  1562. '("n" "Notes" plain (function org-roam-capture--get-point)
  1563. "%?"
  1564. :file-name "docs/notes/${slug}"
  1565. :unnarrowed t
  1566. :head
  1567. "
  1568. ,#+TITLE: ${title}
  1569. ,#+AUTHOR: Christopher James Hayward
  1570. ,#+OPTIONS: num:nil todo:nil tasks:nil
  1571. ,#+EXPORT_FILE_NAME: ${slug}
  1572. ,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/
  1573. ,#+HUGO_BASE_DIR: ../
  1574. ,#+HUGO_AUTO_SET_LASTMOD: t
  1575. ,#+HUGO_SECTION: notes
  1576. ,#+HUGO_DRAFT: true
  1577. "))
  1578. #+END_SRC
  1579. ** Reveal
  1580. #+NAME: emacs-reveal-package
  1581. #+BEGIN_SRC nix
  1582. epkgs.ox-reveal
  1583. #+END_SRC
  1584. 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.
  1585. #+NAME: emacs-reveal-elisp
  1586. #+BEGIN_SRC emacs-lisp
  1587. ;; Configure `ox-reveal' as an `org-mode-export' backend.
  1588. (require 'ox-reveal)
  1589. ;; Don't rely on any local software.
  1590. (setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js")
  1591. ;; Create a capture template.
  1592. (add-to-list 'org-roam-capture-templates
  1593. '("s" "Slides" plain (function org-roam-capture--get-point)
  1594. "%?"
  1595. :file-name "docs/slides/${slug}"
  1596. :unnarrowed t
  1597. :head
  1598. "
  1599. ,#+TITLE: ${title}
  1600. ,#+AUTHOR: Christopher James Hayward
  1601. ,#+EMAIL: chris@chrishayward.xyz
  1602. ,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
  1603. ,#+REVEAL_THEME: serif
  1604. ,#+EXPORT_FILE_NAME: ${slug}
  1605. ,#+OPTIONS: reveal_title_slide:nil
  1606. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  1607. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  1608. "))
  1609. #+END_SRC
  1610. ** Passwords
  1611. #+NAME: emacs-pass-extras
  1612. #+BEGIN_SRC nix
  1613. pkgs.pass
  1614. #+END_SRC
  1615. 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.
  1616. #+NAME: emacs-pass-package
  1617. #+BEGIN_SRC nix
  1618. epkgs.password-store
  1619. #+END_SRC
  1620. Configure keybindings for passwords behind =SPC p=:
  1621. | Key | Description |
  1622. |-----+---------------------|
  1623. | p | Copy a password |
  1624. | r | Rename a password |
  1625. | g | Generate a password |
  1626. #+NAME: emacs-pass-elisp
  1627. #+BEGIN_SRC emacs-lisp
  1628. ;; Set the path to the password store.
  1629. (setq password-store-dir (expand-file-name "~/.password-store"))
  1630. ;; Apply custom keybindings.
  1631. (dotfiles/leader
  1632. "p" '(:ignore t :which-key "Passwords")
  1633. "pp" '(password-store-copy :which-key "Copy")
  1634. "pr" '(password-store-rename :which-key "Rename")
  1635. "pg" '(password-store-generate :which-key "Generate"))
  1636. #+END_SRC
  1637. ** MU4E
  1638. #+NAME: emacs-mu4e-extras
  1639. #+BEGIN_SRC nix
  1640. pkgs.mu
  1641. pkgs.isync
  1642. #+END_SRC
  1643. #+NAME: emacs-mu4e-package
  1644. #+BEGIN_SRC nix
  1645. epkgs.mu4e-alert
  1646. #+END_SRC
  1647. #+NAME: emacs-mu4e-config
  1648. #+BEGIN_SRC nix
  1649. home.file.".mbsyncrc" = {
  1650. text = ''
  1651. IMAPStore xyz-remote
  1652. Host mail.chrishayward.xyz
  1653. User chris@chrishayward.xyz
  1654. PassCmd "pass chrishayward.xyz/chris"
  1655. SSLType IMAPS
  1656. MaildirStore xyz-local
  1657. Path ~/.cache/mail/
  1658. Inbox ~/.cache/mail/inbox
  1659. SubFolders Verbatim
  1660. Channel xyz
  1661. Far :xyz-remote:
  1662. Near :xyz-local:
  1663. Patterns * !Archives
  1664. Create Both
  1665. Expunge Both
  1666. SyncState *
  1667. '';
  1668. };
  1669. #+END_SRC
  1670. #+BEGIN_SRC sh
  1671. mbsync -a
  1672. mu init --maildir="~/.cache/mail" --my-address="chris@chrishayward.xyz"
  1673. mu index
  1674. #+END_SRC
  1675. #+NAME: emacs-mu4e-elisp
  1676. #+BEGIN_SRC emacs-lisp
  1677. ;; Add the `mu4e' shipped with `mu' to the load path.
  1678. (add-to-list 'load-path "/etc/profiles/per-user/chris/share/emacs/site-lisp/mu4e/")
  1679. (require 'mu4e)
  1680. ;; Confiugure `mu4e'.
  1681. (setq mu4e-maildir "~/.cache/mail"
  1682. mu4e-update-interval (* 5 60)
  1683. mu4e-get-mail-command "mbsync -a"
  1684. mu4e-compose-format-flowed t
  1685. mu4e-change-filenames-when-moving t
  1686. mu4e-compose-signature (concat "Chris Hayward\n"
  1687. "chris@chrishayward.xyz"))
  1688. ;; Sign all outbound email with GPG.
  1689. (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
  1690. (setq message-send-mail-function 'smtpmail-send-it
  1691. mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
  1692. ;; Setup `mu4e' accounts.
  1693. (setq mu4e-contexts
  1694. (list
  1695. ;; Main
  1696. ;; chris@chrishayward.xyz
  1697. (make-mu4e-context
  1698. :name "Main"
  1699. :match-func
  1700. (lambda (msg)
  1701. (when msg
  1702. (string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
  1703. :vars
  1704. '((user-full-name . "Christopher James Hayward")
  1705. (user-mail-address . "chris@chrishayward.xyz")
  1706. (smtpmail-smtp-server . "mail.chrishayward.xyz")
  1707. (smtpmail-smtp-service . 587)
  1708. (smtpmail-stream-type . starttls)))))
  1709. ;; Setup `mu4e-alert'.
  1710. (setq mu4e-alert-set-default-style 'libnotify)
  1711. (mu4e-alert-enable-notifications)
  1712. (mu4e-alert-enable-mode-line-display)
  1713. ;; Open the `mu4e' dashboard.
  1714. (dotfiles/leader
  1715. "m" '(mu4e :which-key "Mail"))
  1716. #+END_SRC
  1717. ** Projectile
  1718. #+NAME: emacs-projectile-package
  1719. #+BEGIN_SRC nix
  1720. epkgs.projectile
  1721. #+END_SRC
  1722. 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.
  1723. #+NAME: emacs-projectile-elisp
  1724. #+BEGIN_SRC emacs-lisp
  1725. ;; Configure the `projectile-project-search-path'.
  1726. (setq projectile-project-search-path '("~/.local/source"))
  1727. (projectile-mode +1)
  1728. #+END_SRC
  1729. ** LSP Mode
  1730. #+NAME: emacs-lsp-package
  1731. #+BEGIN_SRC nix
  1732. epkgs.lsp-mode
  1733. epkgs.lsp-ui
  1734. #+END_SRC
  1735. The Language Server Protocol (LSP)[fn:66] defines the protocol used between an Editor or IDE, and a language server that provides features like:
  1736. + Auto Complete
  1737. + Go To Defintion
  1738. + Find All References
  1739. #+NAME: emacs-lsp-elisp
  1740. #+BEGIN_SRC emacs-lisp
  1741. ;; Configure `lsp-mode'.
  1742. (setq lsp-idle-delay 0.5
  1743. lsp-prefer-flymake t)
  1744. ;; Configure `lsp-ui'.
  1745. (setq lsp-ui-doc-position 'at-point
  1746. lsp-ui-doc-delay 0.5)
  1747. #+END_SRC
  1748. ** Company Mode
  1749. #+NAME: emacs-company-package
  1750. #+BEGIN_SRC nix
  1751. epkgs.company
  1752. #+END_SRC
  1753. 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.
  1754. #+NAME: emacs-company-elisp
  1755. #+BEGIN_SRC emacs-lisp
  1756. ;; Configure `company-mode'.
  1757. (setq company-backend 'company-capf
  1758. lsp-completion-provider :capf)
  1759. ;; Enable it globally.
  1760. (global-company-mode +1)
  1761. #+END_SRC
  1762. ** Go Mode
  1763. #+NAME: emacs-golang-package
  1764. #+BEGIN_SRC nix
  1765. epkgs.go-mode
  1766. #+END_SRC
  1767. Go Mode[fn:68] is a major mode for editing Golang[fn:18] source code in GNU/Emacs[fn:2].
  1768. #+NAME: emacs-golang-elisp
  1769. #+BEGIN_SRC emacs-lisp
  1770. ;; Configure `go-mode' to work with `lsp-mode'.
  1771. (defun dotfiles/go-hook ()
  1772. (add-hook 'before-save-hook #'lsp-format-buffer t t)
  1773. (add-hook 'before-save-hook #'lsp-organize-imports t t))
  1774. ;; Configure a custom `before-save-hook'.
  1775. (add-hook 'go-mode-hook #'dotfiles/go-hook)
  1776. #+END_SRC
  1777. ** Rustic
  1778. #+NAME: emacs-rustic-package
  1779. #+BEGIN_SRC nix
  1780. epkgs.rustic
  1781. #+END_SRC
  1782. Rustic[fn:69] is a fork of rust-mode that integrates well with the Language Server Protocol[fn:66]. Include the rust shell before launching GNU/Emacs[fn:2] to use this!
  1783. #+NAME: emacs-rustic-elisp
  1784. #+BEGIN_SRC emacs-lisp
  1785. ;; Configure `rustic' with `lsp-mode'.
  1786. (setq rustic-format-on-save t)
  1787. #+END_SRC
  1788. ** Python Mode
  1789. #+NAME: emacs-python-package
  1790. #+BEGIN_SRC nix
  1791. epkgs.pretty-mode
  1792. #+END_SRC
  1793. The built in Python Mode[fn:70] 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].
  1794. #+NAME: emacs-python-elisp
  1795. #+BEGIN_SRC emacs-lisp
  1796. ;; Configure `pretty-mode' to work with `python-mode'.
  1797. (add-hook 'python-mode-hook
  1798. (lambda ()
  1799. (turn-on-pretty-mode)))
  1800. #+END_SRC
  1801. ** PlantUML
  1802. #+NAME: emacs-plantuml-extras
  1803. #+BEGIN_SRC nix
  1804. pkgs.plantuml
  1805. #+END_SRC
  1806. PlantUML[fn:71] is an open-source tool allowing users to create diagrams from a plain-text language. Besides various UML diagrams, PlantUML[fn:71] has support for various other software developmented related formats, as well as visualizations of =JSON= and =YAML= files.
  1807. #+NAME: emacs-plantuml-package
  1808. #+BEGIN_SRC nix
  1809. epkgs.plantuml-mode
  1810. #+END_SRC
  1811. PlantUML Mode[fn:72] is a major mode for editing PlantUML[fn:71] sources in GNU/Emacs[fn:2].
  1812. #+NAME: emacs-plantuml-elisp
  1813. #+BEGIN_SRC emacs-lisp
  1814. ;; Configure `plantuml-mode'.
  1815. (add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
  1816. (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t)))
  1817. (setq plantuml-default-exec-mode 'executable
  1818. org-plantuml-exec-mode 'plantuml)
  1819. #+END_SRC
  1820. ** Swiper
  1821. #+NAME: emacs-swiper-package
  1822. #+BEGIN_SRC nix
  1823. epkgs.ivy
  1824. epkgs.counsel
  1825. epkgs.ivy-rich
  1826. epkgs.ivy-posframe
  1827. epkgs.ivy-prescient
  1828. #+END_SRC
  1829. Ivy (Swiper)[fn:73] 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.
  1830. #+NAME: emacs-swiper-elisp
  1831. #+BEGIN_SRC emacs-lisp
  1832. ;; Configure `ivy'.
  1833. (setq counsel-linux-app-format-function
  1834. #'counsel-linux-app-format-function-name-only)
  1835. (ivy-mode +1)
  1836. (counsel-mode +1)
  1837. ;; Configure `ivy-rich'.
  1838. (ivy-rich-mode +1)
  1839. ;; Configure `ivy-posframe'.
  1840. (setq ivy-posframe-parameters '((parent-frame nil))
  1841. ivy-posframe-display-functions-alist '((t . ivy-posframe-display)))
  1842. (ivy-posframe-mode +1)
  1843. ;; Configure `ivy-prescient'.
  1844. (setq ivy-prescient-enable-filtering nil)
  1845. (ivy-prescient-mode +1)
  1846. #+END_SRC
  1847. ** Transparency
  1848. 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.
  1849. #+NAME: emacs-transparency-elisp
  1850. #+BEGIN_SRC emacs-lisp
  1851. ;; Configure the default frame transparency.
  1852. (set-frame-parameter (selected-frame) 'alpha '(95 . 95))
  1853. (add-to-list 'default-frame-alist '(alpha . (95 . 95)))
  1854. #+END_SRC
  1855. ** Desktop Environment
  1856. #+NAME: emacs-desktop-extras
  1857. #+BEGIN_SRC nix
  1858. pkgs.brightnessctl
  1859. #+END_SRC
  1860. The Desktop Environment[fn:74] package provides commands and a global minor mode for controlling your GNU/Linux[fn:1] desktop from within GNU/Emacs[fn:2].
  1861. #+NAME: emacs-desktop-package
  1862. #+BEGIN_SRC nix
  1863. epkgs.desktop-environment
  1864. #+END_SRC
  1865. You can control the brightness, volume, take screenshots, and lock / unlock the screen. The package depends on the availability of shell commands to do the heavy lifting. They can be changed by customizing the appropriate variables.
  1866. #+NAME: emacs-desktop-elisp
  1867. #+BEGIN_SRC emacs-lisp
  1868. ;; Configure `desktop-environment'.
  1869. (require 'desktop-environment)
  1870. (desktop-environment-mode +1)
  1871. #+END_SRC
  1872. ** Doom Themes
  1873. #+NAME: emacs-doom-themes-package
  1874. #+BEGIN_SRC nix
  1875. epkgs.doom-themes
  1876. #+END_SRC
  1877. Doom Themes[fn:75] is a theme megapack for GNU/Emacs[fn:2], inspired by community favourites.
  1878. #+NAME: emacs-doom-themes-elisp
  1879. #+BEGIN_SRC emacs-lisp
  1880. ;; Include modern themes from `doom-themes'.
  1881. (setq doom-themes-enable-bold t
  1882. doom-themes-enable-italic t)
  1883. ;; Load the `doom-moonlight' theme.
  1884. (load-theme 'doom-moonlight t)
  1885. (doom-modeline-mode +1)
  1886. ;; Load a new theme with <SPC> t t.
  1887. (dotfiles/leader
  1888. "tt" '(counsel-load-theme :which-key "Theme"))
  1889. #+END_SRC
  1890. ** Doom Modeline
  1891. #+NAME: emacs-doom-modeline-package
  1892. #+BEGIN_SRC nix
  1893. epkgs.doom-modeline
  1894. #+END_SRC
  1895. Doom Modeline[fn:76] is a fancy and fast modeline inspired by minimalism design. It's integrated into Centaur Emacs, Doom Emacs, and Spacemacs.
  1896. #+NAME: emacs-doom-modeline-elisp
  1897. #+BEGIN_SRC emacs-lisp
  1898. ;; Add the `doom-modeline' after initialization.
  1899. (add-hook 'after-init-hook 'doom-modeline-mode)
  1900. (setq doom-modeline-height 16
  1901. doom-modeline-icon t)
  1902. #+END_SRC
  1903. * Footnotes
  1904. [fn:1] https://gnu.org
  1905. [fn:2] https://gnu.org/software/emacs/
  1906. [fn:3] https://literateprogramming.com/knuthweb.pdf
  1907. [fn:4] https://nixos.org/manual/nixos/stable
  1908. [fn:5] https://nixos.org/manual/nix/stable
  1909. [fn:6] https://nixos.org/manual/nixpkgs/stable
  1910. [fn:7] https://github.com/nix-community/home-manager
  1911. [fn:8] https://github.com/nix-community/emacs-overlay
  1912. [fn:9] https://github.com/nixos/nixos-hardware
  1913. [fn:10] https://github.com/t184256/nix-on-droid
  1914. [fn:11] https://qemu.org
  1915. [fn:12] https://github.com/ch11ng/exwm
  1916. [fn:13] https://evil.readthedocs.io/en/latest/overview.html
  1917. [fn:14] https://samsung.com/us/mobile/galaxy-s10/buy/
  1918. [fn:15] https://www.raspberrypi.org/products/raspberry-pi-4-model-b/
  1919. [fn:16] https://raspberrypi.org/products/raspberry-pi-400/
  1920. [fn:17] https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html
  1921. [fn:18] https://golang.org
  1922. [fn:19] https://grpc.io
  1923. [fn:20] https://iso.org/standard/74528.html
  1924. [fn:21] https://en.wikipedia.org/wiki/C++
  1925. [fn:22] https://python.org
  1926. [fn:23] https://x.org/wiki/
  1927. [fn:24] https://wayland.freedesktop.org
  1928. [fn:25] https://nixos.wiki/wiki/Flakes
  1929. [fn:26] https://nix-community.cachix.org
  1930. [fn:27] https://docker.org
  1931. [fn:28] https://en.wikipedia.org/wiki/Firefox
  1932. [fn:29] https://jellyfin.org
  1933. [fn:30] https://moonlight-stream.org
  1934. [fn:31] https://teamviewer.com
  1935. [fn:32] https://git-scm.com
  1936. [fn:33] https://emacswiki.org/emacs/LearnEmacsLisp
  1937. [fn:34] https://neovim.io
  1938. [fn:35] https://gtk.org
  1939. [fn:36] https://github.com/nixos/nix-mode
  1940. [fn:37] https://github.com/noctuid/general.el
  1941. [fn:38] https://github.com/justbur/emacs-which-key
  1942. [fn:39] https://emacswiki.org/emacs/eww
  1943. [fn:40] https://emacswiki.org/emacs/DiredMode
  1944. [fn:41] https://emacswiki.org/emacs/DiredExtra#Dired_X
  1945. [fn:42] https://github.com/domtronn/all-the-icons.el
  1946. [fn:43] https://github.com/iqbalansari/emacs-emojify
  1947. [fn:44] https://gnu.org/software/emacs/manual/html_mono/eshell.html
  1948. [fn:45] https://github.com/akermu/emacs-libvterm
  1949. [fn:46] https://github.com/neovim/libvterm
  1950. [fn:47] https://magit.vc
  1951. [fn:48] https://github.com/skeeto/elfeed
  1952. [fn:49] https://orgmode.org
  1953. [fn:50] https://github.com/org-roam/org-roam
  1954. [fn:51] https://zettelkasten.de
  1955. [fn:52] https://github.com/org-roam/org-roam-server
  1956. [fn:53] https://orgmode.org/worg/org-contrib/org-drill.html
  1957. [fn:54] https://marcinkoziej/org-pomodoro
  1958. [fn:55] https://en.wikipedia.org/wiki/Pomodoro_Technique
  1959. [fn:56] https://github.com/bnbeckwith/writegood-mode
  1960. [fn:57] https://aspell.net
  1961. [fn:58] https://gohugo.io
  1962. [fn:59] https://oxhugo.scripter.co
  1963. [fn:60] https://chrishayward.xyz/posts/
  1964. [fn:61] https://chrishayward.xyz/notes/
  1965. [fn:62] https://revealjs.com
  1966. [fn:63] https://github.com/hexmode/ox-reveal
  1967. [fn:64] https://password-store.org
  1968. [fn:65] https://projectile.mx
  1969. [fn:66] https://microsoft.github.io/language-server-protocol
  1970. [fn:67] https://company-mode.github.io
  1971. [fn:68] https://emacswiki.org/emacs/GoMode
  1972. [fn:69] https://github.com/brotzeit/rustic
  1973. [fn:70] https://emacswiki.org/emacs/PythonProgrammingInEmacs
  1974. [fn:71] https://plantuml.com
  1975. [fn:72] https://github.com/skuro/plantuml-mode
  1976. [fn:73] https://github.com/abo-abo/swiper
  1977. [fn:74] https://github.com/DamienCassou/desktop-environment
  1978. [fn:75] https://github.com/hlissner/emacs-doom-themes
  1979. [fn:76] https://github.com/seagle0128/doom-modeline
  1980. [fn:77] https://laptopmedia.com/laptop-specs/acer-nitro-5-an515-53-2