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.

3117 lines
90 KiB

3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. :PROPERTIES:
  2. :ID: e4ad3dd5-0996-45bc-92ab-6bdbf16e4310
  3. :ROAM_REFS: https://chrishayward.xyz/dotfiles/
  4. :END:
  5. #+TITLE: Dotfiles
  6. #+AUTHOR: Christopher James Hayward
  7. #+EMAIL: chris@chrishayward.xyz
  8. #+EXPORT_FILE_NAME: dotfiles
  9. #+HUGO_BASE_DIR: docs
  10. #+HUGO_AUTO_SET_LASTMOD: t
  11. #+HUGO_SECTION:
  12. #+HUGO_DRAFT: false
  13. #+HTML: <a href="https://nixos.org"><img src="https://img.shields.io/badge/NixOS-unstable-blue.svg?style=flat-square&logo=NixOS&logoColor=white"></a>
  14. #+HTML: <a href="https://www.gnu.org/software/emacs/"><img src="https://img.shields.io/badge/Emacs-28.0.50-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=white"></a>
  15. #+HTML: <a href="https://orgmode.org"><img src="https://img.shields.io/badge/Org-9.4.6-%2377aa99?style=flat-square&logo=org&logoColor=white"></a>
  16. #+NAME: description
  17. #+BEGIN_SRC text
  18. Immutable NixOS dotfiles.
  19. #+END_SRC
  20. #+ATTR_ORG: :width 800px
  21. #+ATTR_HTML: :width 800px
  22. #+ATTR_LATEX: :width 800px
  23. [[./docs/images/desktop-example.png]]
  24. Built for Life, Liberty, and the Open Road.
  25. + 100% Immutable
  26. + 100% Declarative
  27. + 100% Reproducible
  28. * Introduction
  29. 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.
  30. #+NAME: file-warning
  31. #+BEGIN_SRC text
  32. This file is controlled by /etc/dotfiles/README.org
  33. #+END_SRC
  34. ** Getting Started
  35. 1) Download the latest version of NixOS https://nixos.org/download.html
  36. 2) Partition drives and mount the file system https://nixos.org/manual/nixos/stable/#sec-installation-partitioning
  37. 3) Clone the project to =/mnt/etc/dotfiles= ~git clone git@git.chrishayward.xyz:chris/dotfiles /mnt/etc/dotfiles~
  38. 4) Load the default shell environment ~nix-shell /mnt/etc/dotfiles~
  39. 5) Install the default system ~sudo nixos-install --flake /mnt/etc/dotfiles#nixos~
  40. 6) Reboot and login, start a graphical system with ~startx~
  41. ** Making Changes
  42. 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:
  43. + boot :: Build the new configuration and make it the boot default, without activation
  44. + test :: Build and activate the new configuration, without adding it to the boot menu
  45. + switch :: Build and activate the new configuration, making it the new boot default
  46. + build :: Build the new configuration, without activation, nor adding it to the boot menu
  47. + build-vm :: Build a script that starts a virtual machine with the desired configuration
  48. #+BEGIN_SRC shell
  49. # Build and activate a new configuration.
  50. sudo nixos-rebuild switch --flake $FLAKE#$HOSTNAME
  51. #+END_SRC
  52. 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.
  53. #+BEGIN_SRC shell
  54. # Rollback to the previous generation.
  55. sudo nixos-rebuild switch --rollback
  56. #+END_SRC
  57. ** Docker Container
  58. It's possible to use parts of this configuration using a 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.
  59. #+BEGIN_SRC dockerfile :tangle Dockerfile :noweb yes
  60. # <<file-warning>>
  61. # Derive from the official image.
  62. FROM nixos/nix
  63. # Setup the default environment.
  64. WORKDIR /etc/dotfiles
  65. COPY . .
  66. # Load the default system shell.
  67. RUN nix-shell /etc/dotfiles/shell.nix
  68. #+END_SRC
  69. * Operating System
  70. 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.
  71. #+BEGIN_SRC nix :noweb yes :tangle flake.nix
  72. # <<file-warning>>
  73. {
  74. description = "<<description>>";
  75. inputs = {
  76. <<os-nixpkgs>>
  77. <<os-home-manager>>
  78. <<os-emacs-overlay>>
  79. <<os-nixos-hardware>>
  80. <<os-nix-on-droid>>
  81. };
  82. outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }: {
  83. nixosConfigurations = {
  84. <<host-default>>
  85. <<host-acernitro>>
  86. <<host-raspberry>>
  87. <<host-homecloud>>
  88. <<host-android>>
  89. };
  90. };
  91. }
  92. #+END_SRC
  93. ** Nixpkgs
  94. 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:
  95. 1) The current stable release
  96. 2) The Unstable branch following the latest development
  97. #+NAME: os-nixpkgs
  98. #+BEGIN_SRC nix
  99. nixpkgs.url = "nixpkgs/nixos-unstable";
  100. nixpkgs-unstable.url = "nixpkgs/master";
  101. #+END_SRC
  102. ** Home Manager
  103. 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.
  104. #+NAME: os-home-manager
  105. #+BEGIN_SRC nix
  106. home-manager.url = "github:nix-community/home-manager";
  107. home-manager.inputs.nixpkgs.follows = "nixpkgs";
  108. #+END_SRC
  109. ** Emacs Overlay
  110. 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.
  111. #+NAME: os-emacs-overlay
  112. #+BEGIN_SRC nix
  113. emacs-overlay.url = "github:nix-community/emacs-overlay";
  114. #+END_SRC
  115. ** NixOS Hardware
  116. 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.
  117. #+NAME: os-nixos-hardware
  118. #+BEGIN_SRC nix
  119. nixos-hardware.url = "github:nixos/nixos-hardware";
  120. #+END_SRC
  121. ** Nix On Droid
  122. 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.
  123. #+NAME: os-nix-on-droid
  124. #+BEGIN_SRC nix
  125. nix-on-droid.url = "github:t184256/nix-on-droid/master";
  126. nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
  127. #+END_SRC
  128. * Development Shells
  129. The command ~nix-shell~[fn:11] 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.
  130. Import this shell with ~nix-shell /etc/dotfiles/shell.nix~.
  131. #+BEGIN_SRC nix :noweb yes :tangle shell.nix
  132. # <<file-warning>>
  133. { pkgs ? import <nixpkgs> { } }:
  134. with pkgs;
  135. let
  136. nixBin = writeShellScriptBin "nix" ''
  137. ${nixFlakes}/bin/nix --option experimental-features "nix-command flakes" "$@"
  138. '';
  139. in mkShell {
  140. buildInputs = [
  141. git
  142. ];
  143. shellHook = ''
  144. export FLAKE="$(pwd)"
  145. export PATH="$FLAKE/bin:${nixBin}/bin:$PATH"
  146. '';
  147. }
  148. #+END_SRC
  149. ** Go
  150. Go[fn:12] 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.
  151. Import this shell with ~nix-shell /etc/dotfiles/shells/go.nix~
  152. #+BEGIN_SRC nix :noweb yes :tangle shells/go.nix
  153. # <<file-warning>>
  154. { pkgs ? import <nixpkgs> { } }:
  155. with pkgs;
  156. mkShell {
  157. buildInputs = [
  158. go
  159. gopls
  160. # FIXME: Broken on nixpkgs/unstable.
  161. # protoc-gen-go
  162. # protoc-gen-go-grpc
  163. ];
  164. shellHook = ''
  165. export GO111MODULE=on
  166. export GOPATH=$XDG_DATA_HOME/go
  167. export PATH=$GOPATH/bin:$PATH
  168. '';
  169. }
  170. #+END_SRC
  171. ** Rust
  172. Rust[fn:13] is a multi-paradigm programming language designed for performance and safety, especially safe concurrency. It is syntactically similar to C++, but can garantee memory safety by using a borrow checker to validate references. Rust[fn:13] achieves memory safety /without/ garbage collection, and reference counting is optional.
  173. Import this shell with ~nix-shell /etc/dotfiles/shells/rust.nix~.
  174. #+BEGIN_SRC nix :noweb yes :tangle shells/rust.nix
  175. # <<file-warning>>
  176. { pkgs ? import <nixpkgs> { } }:
  177. with pkgs;
  178. mkShell {
  179. buildInputs = [
  180. rustup
  181. ];
  182. shellHook = ''
  183. export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
  184. export CARGO_HOME="$XDG_DATA_HOME/cargo"
  185. export PATH="$CARGO_HOME/bin:$PATH"
  186. '';
  187. }
  188. #+END_SRC
  189. ** Node
  190. Node.js[fn:14] is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine, and executes JavaScript code outside of a web browser. Node.js[fn:14] lets developers user JavaScript to write command line tools, and for server-side scripting to produce dynamic web page content.
  191. Import this shell with ~nix-shell /etc/dotfiles/shells/node.nix~.
  192. #+BEGIN_SRC nix :noweb yes :tangle shells/node.nix
  193. # <<file-warning>>
  194. { pkgs ? import <nixpkgs> { } }:
  195. with pkgs;
  196. mkShell {
  197. buildInputs = [
  198. nodejs
  199. yarn
  200. ];
  201. shellHook = ''
  202. export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR/npm"
  203. export NPM_CONFIG_CACHE="$XDG_CACHE_HOME/npm"
  204. export NPM_CACHE_PREFIX="$XDG_CACHE_HOME/npm"
  205. export PATH="$(yarn global bin):$PATH"
  206. '';
  207. }
  208. #+END_SRC
  209. ** Java
  210. OpenJDK[fn:15] is a free and open-source implementation of the Java Platform, Standard Edition. It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GNU General Public License Version 2 with a linking exception.
  211. Import this shell with ~nix-shell /etc/dotfiles/shells/java.nix~.
  212. #+BEGIN_SRC nix :noweb yes :tangle shells/java.nix
  213. # <<file-warning>>
  214. { pkgs ? import <nixpkgs> { } }:
  215. with pkgs;
  216. mkShell {
  217. buildInputs = [
  218. # openjdk8 # Legacy Java 8 VM.
  219. # openjdk11 # Current LTS version of OpenJDK.
  220. openjdk14 # Current version of OpenJDK.
  221. ];
  222. shellHook = ''
  223. '';
  224. }
  225. #+END_SRC
  226. ** gRPC
  227. gRPC[fn:16] 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.
  228. Import this shell with ~nix-shell /etc/dotfiles/shells/grpc.nix~.
  229. #+BEGIN_SRC nix :noweb yes :tangle shells/grpc.nix
  230. # <<file-warning>>
  231. { pkgs ? import <nixpkgs> { } }:
  232. with pkgs;
  233. mkShell {
  234. buildInputs = [
  235. grpc
  236. grpcui
  237. grpcurl
  238. # FIXME: Broken on nixpkgs/unstable.
  239. # grpc-tools
  240. ];
  241. shellHook = ''
  242. '';
  243. }
  244. #+END_SRC
  245. ** C/C++
  246. C[fn:17] 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:18] is a general-purpose programming language created as an extension of the C[fn:17] programming language.
  247. Import this shell with ~nix-shell /etc/dotfiles/shells/cc.nix~.
  248. #+BEGIN_SRC nix :noweb yes :tangle shells/cc.nix
  249. # <<file-warning>>
  250. { pkgs ? import <nixpkgs> { } }:
  251. with pkgs;
  252. mkShell {
  253. buildInputs = [
  254. gdb
  255. ccls
  256. cmake
  257. gnumake
  258. gcc-unwrapped
  259. ];
  260. shellHook = ''
  261. '';
  262. }
  263. #+END_SRC
  264. ** Python
  265. Python[fn:19] 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.
  266. Import this shell with ~nix-shell /etc/dotfiles/shells/python.nix~
  267. #+BEGIN_SRC nix :noweb yes :tangle shells/python.nix
  268. # <<file-warning>>
  269. { pkgs ? import <nixpkgs> { } }:
  270. with pkgs;
  271. mkShell {
  272. buildInputs = [
  273. python38Packages.pip
  274. python38Packages.pip-tools
  275. python38Packages.pyls-mypy
  276. python38Packages.pyls-isort
  277. python38Packages.pyls-black
  278. ];
  279. shellHook = ''
  280. '';
  281. }
  282. #+END_SRC
  283. ** Docker
  284. Compose[fn:20] is a tool for defining and running multi-container Docker[fn:21] applications. With Compose[fn:20], you use a YAML file to configure your application services. Then, with a single command, you create and start all of the services from your configuration.
  285. Machine[fn:22] is a tool that lets you install Docker Engine on virtual hosts, and manage the hosts with ~docker-machine~ commands. You can use Machine[fn:22] to create hosts on your local box, company network, data center, or on any cloud provider.
  286. Import this shell with ~nix-shell /etc/dotfiles/shells/docker.nix~
  287. #+BEGIN_SRC nix :noweb yes :tangle shells/docker.nix
  288. # <<file-warning>>
  289. { pkgs ? import <nixpkgs> { } }:
  290. with pkgs;
  291. mkShell {
  292. buildInputs = [
  293. docker-compose
  294. docker-machine
  295. ];
  296. shellHook = ''
  297. '';
  298. }
  299. #+END_SRC
  300. ** Heroku
  301. Heroku[fn:23] is a cloud platform as a service supporting several programming languages. One of the first cloud platforms, Heroku[fn:23] has been in development since June 2007, when it supported only the Ruby programming language. It now supports Java, Node.js, Scala, Clojure, Python, PHP, and Go.
  302. Import this shell with ~nix-shell /etc/dotfiles/shells/heroku.nix~
  303. #+BEGIN_SRC nix :noweb yes :tangle shells/heroku.nix
  304. # <<file-warning>>
  305. { pkgs ? import <nixpkgs> { } }:
  306. with pkgs;
  307. mkShell {
  308. buildInputs = [
  309. heroku
  310. ];
  311. shellHook = ''
  312. '';
  313. }
  314. #+END_SRC
  315. * Host Configurations
  316. 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. It also makes it easier to share common configurations amongst all of the hosts, such as with pre-configured wireless networking:
  317. #+NAME: host-config-wifi
  318. #+BEGIN_SRC nix
  319. networking.wireless.networks = {
  320. MyWiFi_5C1870 = {
  321. priority = 3;
  322. pskRaw = "409b3c85fef1c5737f284d2f82f20dc6023e41804e862d4fa26265ef8193b326";
  323. };
  324. BELL182 = {
  325. priority = 2;
  326. pskRaw = "8b3c114c695c5013bbcf5fc0af781c7872f95c34e2cceb31afa7bfc1adf66245";
  327. };
  328. SM-G975W3034 = {
  329. priority = 1;
  330. pskRaw = "74835d96a98ca2c56ffe4eaf92223f8a555168b59ec2bb22b1e46b2a333adc80";
  331. };
  332. };
  333. #+END_SRC
  334. It's helpful to add the machine hostnames to the networking configuration, so I can refer to another host across the network by name. Some devices that can have more than one IP (WIFI / Ethernet) will have the wireless hostname suffixed:
  335. #+NAME: host-config-home
  336. #+BEGIN_SRC nix
  337. networking.hosts = {
  338. "192.168.3.105" = [ "gamingpc" ];
  339. "192.168.3.163" = [ "acernitro" ];
  340. "192.168.3.182" = [ "raspberry" ];
  341. "192.168.3.183" = [ "homecloud" ];
  342. };
  343. #+END_SRC
  344. Setting up new machines, especially headless ones like the Raspberry Pi Zero, can be difficult with NixOS. I find it easier to setup automatic network configuration, and wait for the machine to appear on the network. This is complimented with a pre-authorized SSH key, making it simple to connect and complete the installation headlessly.
  345. #+NAME: host-config-ssh
  346. #+BEGIN_SRC nix
  347. users.users.chris.openssh.authorizedKeys.keys = [
  348. "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO4wka/LfG3pto15DIm9LIRbb6rWr7/ipCRiCdAKSlY4 chris@chrishayward.xyz"
  349. ];
  350. #+END_SRC
  351. ** Default
  352. The default host, built using QEMU[fn:24], 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:25] as the graphical environment.
  353. #+NAME: host-default
  354. #+BEGIN_SRC nix :noweb yes
  355. nixos = nixpkgs.lib.nixosSystem {
  356. system = "x86_64-linux";
  357. specialArgs = { inherit inputs; };
  358. modules = [
  359. ./hosts/nixos
  360. <<module-x11>>
  361. <<module-ssh>>
  362. <<module-flakes>>
  363. <<module-cachix>>
  364. <<module-home-manager>>
  365. ];
  366. };
  367. #+END_SRC
  368. Deploy this configuration with ~nixos-rebuild switch --flake /etc/dotfiles/#nixos~.
  369. #+BEGIN_SRC nix :noweb yes :tangle hosts/nixos/default.nix
  370. # <<file-warning>>
  371. { ... }:
  372. {
  373. imports = [
  374. ./configuration.nix
  375. ./hardware.nix
  376. ];
  377. }
  378. #+END_SRC
  379. *** Configuration
  380. 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.
  381. #+BEGIN_SRC nix :noweb yes :tangle hosts/nixos/configuration.nix
  382. # <<file-warning>>
  383. { config, pkgs, inputs, ... }:
  384. {
  385. time.timeZone = "America/Toronto";
  386. networking.hostName = "nixos";
  387. networking.useDHCP = false;
  388. networking.firewall.enable = false;
  389. networking.interfaces.ens3.useDHCP = true;
  390. <<host-config-home>>
  391. <<host-config-ssh>>
  392. programs.mtr.enable = true;
  393. programs.fish.enable = true;
  394. programs.gnupg.agent.enable = true;
  395. users.users.chris = {
  396. shell = pkgs.fish;
  397. isNormalUser = true;
  398. extraGroups = [ "wheel" ];
  399. };
  400. }
  401. #+END_SRC
  402. *** Hardware
  403. The file system for this host is a single 24GB QCOW file, a format for disk images used by QEMU[fn:24]. The file can be recreated easily by following the steps listed in the NixOS[fn:4] installation manual, specifically the section on disk formatting.
  404. #+BEGIN_SRC nix :noweb yes :tangle hosts/nixos/hardware.nix
  405. # <<file-warning>>
  406. { config, lib, pkgs, modulesPath, ... }:
  407. {
  408. imports =
  409. [ (modulesPath + "/profiles/qemu-guest.nix")
  410. ];
  411. boot.initrd.availableKernelModules = [ "ata_piix" "floppy" "sd_mod" "sr_mod" ];
  412. boot.initrd.kernelModules = [ ];
  413. boot.kernelModules = [ ];
  414. boot.extraModulePackages = [ ];
  415. boot.loader.grub.enable = true;
  416. boot.loader.grub.version = 2;
  417. boot.loader.grub.device = "/dev/sda";
  418. fileSystems."/" =
  419. { device = "/dev/disk/by-uuid/fddc37ff-a442-41fa-afc4-abf878be7c5a";
  420. fsType = "ext4";
  421. };
  422. swapDevices =
  423. [ { device = "/dev/disk/by-uuid/5fc0e3df-e796-4fe2-8482-c6acaed9d36f"; }
  424. ];
  425. }
  426. #+END_SRC
  427. ** Acernitro
  428. My gaming laptop, the model is an Acer Nitro AN-515-53[fn:26]. 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.
  429. Here are the specs:
  430. | Slot | Component |
  431. |---------+---------------------------------------|
  432. | CPU | Intel Core i5-8300H |
  433. | GPU | NVIDIA GeForce GTX 1050Ti (4GB GDDR5) |
  434. | RAM | 16GB DDR4 |
  435. | Display | 15.6" Full HD (1920 x 1080), IPS |
  436. | Storage | 1000GB HDD |
  437. | Weight | 2.48kg (5.5 lbs) |
  438. #+NAME: host-acernitro
  439. #+BEGIN_SRC nix :noweb yes
  440. acernitro = nixpkgs.lib.nixosSystem {
  441. system = "x86_64-linux";
  442. specialArgs = { inherit inputs; };
  443. modules = [
  444. ./hosts/acernitro
  445. <<module-x11>>
  446. <<module-ssh>>
  447. <<module-hugo>>
  448. <<module-docker>>
  449. <<module-flakes>>
  450. <<module-cachix>>
  451. <<module-nvidia>>
  452. <<module-firefox>>
  453. <<module-moonlight>>
  454. <<module-teamviewer>>
  455. <<module-home-manager>>
  456. ];
  457. };
  458. #+END_SRC
  459. Deploy this configuration with ~nixos-rebuild switch --flake /etc/dotfiles/#acernitro~.
  460. #+BEGIN_SRC nix :noweb yes :tangle hosts/acernitro/default.nix
  461. # <<file-warning>>
  462. { ... }:
  463. {
  464. imports = [
  465. ./configuration.nix
  466. ./hardware.nix
  467. ];
  468. }
  469. #+END_SRC
  470. *** Configuration
  471. This configuration is nearly identical to the default, except for a few key differences:
  472. + Enables sound
  473. + Applies the desired hostname
  474. + Enables power management daemon
  475. + It adds support for =UEFI= systems
  476. + Enables support for wireless networking
  477. #+BEGIN_SRC nix :noweb yes :tangle hosts/acernitro/configuration.nix
  478. # <<file-warning>>
  479. { config, pkgs, inputs, ... }:
  480. {
  481. time.timeZone = "America/Toronto";
  482. networking.hostName = "acernitro";
  483. networking.firewall.enable = false;
  484. networking.wireless.enable = true;
  485. networking.wireless.userControlled.enable = true;
  486. networking.useDHCP = false;
  487. networking.interfaces.enp6s0f1.useDHCP = true;
  488. networking.interfaces.wlp0s20f3.useDHCP = true;
  489. <<host-config-wifi>>
  490. <<host-config-home>>
  491. <<host-config-ssh>>
  492. services.tlp.enable = true;
  493. services.xserver.dpi = 96;
  494. services.xserver.libinput.touchpad.tapping = false;
  495. services.printing.enable = true;
  496. programs.mtr.enable = true;
  497. programs.fish.enable = true;
  498. programs.gnupg.agent.enable = true;
  499. users.users.chris = {
  500. shell = pkgs.fish;
  501. isNormalUser = true;
  502. extraGroups = [ "wheel" ];
  503. };
  504. }
  505. #+END_SRC
  506. *** Hardware
  507. + Enables sound via PulseAudio
  508. + Enables powertop via power management
  509. + Adds support for the NVIDIA Hybrid GPU
  510. #+BEGIN_SRC nix :noweb yes :tangle hosts/acernitro/hardware.nix
  511. # <<file-warning>>
  512. { config, lib, pkgs, modulesPath, ... }:
  513. {
  514. imports =
  515. [ (modulesPath + "/installer/scan/not-detected.nix")
  516. ];
  517. boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
  518. boot.initrd.kernelModules = [ ];
  519. boot.kernelModules = [ "kvm-intel" ];
  520. boot.extraModulePackages = [ ];
  521. boot.loader.systemd-boot.enable = true;
  522. boot.loader.efi.canTouchEfiVariables = true;
  523. sound.enable = true;
  524. hardware.pulseaudio.enable = true;
  525. hardware.pulseaudio.support32Bit = true;
  526. fileSystems."/" =
  527. { device = "/dev/disk/by-uuid/2f548eb9-47ce-4280-950f-9c6d1d162852";
  528. fsType = "ext4";
  529. };
  530. fileSystems."/boot" =
  531. { device = "/dev/disk/by-uuid/5BC3-73F3";
  532. fsType = "vfat";
  533. };
  534. swapDevices =
  535. [ { device = "/dev/disk/by-uuid/bef7bf62-d26f-45b1-a1f8-1227c2f8b26a"; }
  536. ];
  537. powerManagement.powertop.enable = true;
  538. powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
  539. }
  540. #+END_SRC
  541. ** Raspberry
  542. The Raspberry Pi 400[fn:27] 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.
  543. #+NAME: host-raspberry
  544. #+BEGIN_SRC nix :noweb yes
  545. raspberry = nixpkgs.lib.nixosSystem {
  546. system = "aarch64-linux";
  547. specialArgs = { inherit inputs; };
  548. modules = [
  549. ./hosts/raspberry
  550. <<module-x11>>
  551. <<module-ssh>>
  552. <<module-flakes>>
  553. <<module-cachix>>
  554. <<module-home-manager>>
  555. ];
  556. };
  557. #+END_SRC
  558. Deploy this configuration with ~sudo nixos-rebuild switch --flake /etc/dotfiles/#raspberry~.
  559. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/default.nix
  560. # <<file-warning>>
  561. { ... }:
  562. {
  563. imports = [
  564. ./configuration.nix
  565. ./hardware.nix
  566. ];
  567. }
  568. #+END_SRC
  569. *** Configuration
  570. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/configuration.nix
  571. # <<file-warning>>
  572. { config, pkgs, ... }:
  573. {
  574. time.timeZone = "America/Toronto";
  575. networking.hostName = "raspberry";
  576. networking.firewall.enable = false;
  577. networking.networkmanager.enable = true;
  578. networking.interfaces.eth0.useDHCP = true;
  579. networking.interfaces.wlan0.useDHCP = true;
  580. <<host-config-home>>
  581. <<host-config-ssh>>
  582. environment.systemPackages = [
  583. pkgs.libraspberrypi
  584. pkgs.raspberrypi-eeprom
  585. ];
  586. programs.fish.enable = true;
  587. programs.gnupg.agent.enable = true;
  588. users.users.chris = {
  589. shell = pkgs.fish;
  590. isNormalUser = true;
  591. extraGroups = [ "wheel" "networkmanager" ];
  592. };
  593. }
  594. #+END_SRC
  595. *** Hardware
  596. This section is very much a work in progress. I have struggled to get this device to boot according to the NixOS documentation / wiki on the subject. It seems that when running with the vendored kernel there's an issue booting from the SD card. Nevertheless, the issue is avoided by using the standard kernel.
  597. #+BEGIN_SRC nix :noweb yes :tangle hosts/raspberry/hardware.nix
  598. # <<file-warning>>
  599. { config, pkgs, lib, inputs, ... }:
  600. {
  601. # imports = [
  602. # inputs.nixos-hardware.nixosModules.raspberry-pi-4
  603. # ];
  604. # boot.kernelPackages = pkgs.linuxPackages_rpi4;
  605. boot.tmpOnTmpfs = true;
  606. boot.initrd.availableKernelModules = [ "usbhid" "usb_storage" ];
  607. boot.kernelParams = [
  608. "8250.nr_uarts=1"
  609. "console=ttyAMA0,115200"
  610. "console=tty1"
  611. "cma=128M"
  612. ];
  613. boot.loader.grub.enable = false;
  614. boot.loader.generic-extlinux-compatible.enable = true;
  615. boot.loader.raspberryPi = {
  616. enable = true;
  617. version = 4;
  618. firmwareConfig = ''
  619. hdmi_drive=2
  620. hdmi_force_hotplug=1
  621. dtparam=sd_poll_once=on
  622. dtparam=audio=on
  623. '';
  624. };
  625. # FIXME: Requires GPU support.
  626. services.xserver.videoDrivers = [ "fbdev" ];
  627. sound.enable = true;
  628. hardware.pulseaudio.enable = true;
  629. hardware.enableRedistributableFirmware = true;
  630. # hardware.raspberry-pi."4".fkms-3d.enable = true;
  631. fileSystems = {
  632. "/" = {
  633. device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
  634. fsType = "ext4";
  635. options = [ "noatime" ];
  636. };
  637. };
  638. powerManagement.cpuFreqGovernor = "ondemand";
  639. }
  640. #+END_SRC
  641. ** Homecloud
  642. The Raspberry Pi Model B-8GB[fn:28] 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=.
  643. #+NAME: host-homecloud
  644. #+BEGIN_SRC nix :noweb yes
  645. homecloud = nixpkgs.lib.nixosSystem {
  646. system = "aarch64-linux";
  647. specialArgs = { inherit inputs; };
  648. modules = [
  649. ./hosts/homecloud
  650. <<module-ssh>>
  651. <<module-flakes>>
  652. <<module-cachix>>
  653. ];
  654. };
  655. #+END_SRC
  656. Deploy this configuration with ~sudo nixos-rebuild switch --flake /etc/dotfiles/#homecloud~.
  657. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/default.nix
  658. # <<file-warning>
  659. { ... }:
  660. {
  661. imports = [
  662. ./configuration.nix
  663. ./hardware.nix
  664. ];
  665. }
  666. #+END_SRC
  667. *** Configuration
  668. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/configuration.nix
  669. # <<file-warning>>
  670. { config, pkgs, ... }:
  671. {
  672. time.timeZone = "America/Toronto";
  673. networking.hostName = "homecloud";
  674. networking.firewall.enable = false;
  675. networking.networkmanager.enable = true;
  676. networking.interfaces.eth0.useDHCP = true;
  677. networking.interfaces.wlan0.useDHCP = true;
  678. <<host-config-wifi>>
  679. <<host-config-home>>
  680. <<host-config-ssh>>
  681. environment.systemPackages = [
  682. pkgs.libraspberrypi
  683. pkgs.raspberrypi-eeprom
  684. ];
  685. programs.fish.enable = true;
  686. programs.mtr.enable = true;
  687. users.users.chris = {
  688. shell = pkgs.fish;
  689. isNormalUser = true;
  690. extraGroups = [ "wheel" "networkmanager" ];
  691. };
  692. }
  693. #+END_SRC
  694. *** Hardware
  695. #+BEGIN_SRC nix :noweb yes :tangle hosts/homecloud/hardware.nix
  696. # <<file-warning>>
  697. { config, pkgs, lib, inputs, ... }:
  698. {
  699. # imports = [
  700. # inputs.nixos-hardware.nixosModules.raspberry-pi-4
  701. # ];
  702. # boot.kernelPackages = pkgs.linuxPackages_rpi4;
  703. boot.tmpOnTmpfs = true;
  704. boot.initrd.availableKernelModules = [ "usbhid" "usb_storage" ];
  705. boot.kernelParams = [
  706. "8250.nr_uarts=1"
  707. "console=ttyAMA0,115200"
  708. "console=tty1"
  709. "cma=128M"
  710. ];
  711. boot.loader.grub.enable = false;
  712. boot.loader.generic-extlinux-compatible.enable = true;
  713. boot.loader.raspberryPi = {
  714. enable = true;
  715. version = 4;
  716. firmwareConfig = ''
  717. hdmi_drive=2
  718. hdmi_force_hotplug=1
  719. dtparam=sd_poll_once=on
  720. dtparam=audio=on
  721. '';
  722. };
  723. # hardware.raspberry-pi."4".fkms-3d.enable = true;
  724. fileSystems = {
  725. "/" = {
  726. device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
  727. fsType = "ext4";
  728. options = [ "noatime" ];
  729. };
  730. };
  731. powerManagement.cpuFreqGovernor = "ondemand";
  732. }
  733. #+END_SRC
  734. ** Android
  735. This is my Samsung Galaxy S10+[fn:29] running Nix On Droid[fn:10] with the experimental support for Flakes being used to manage the configuration.
  736. #+NAME: host-android
  737. #+BEGIN_SRC nix
  738. android = (inputs.nix-on-droid.lib.aarch64-linux.nix-on-droid {
  739. config = ./hosts/android/nix-on-droid.nix;
  740. }).activationPackage;
  741. #+END_SRC
  742. Build the activation package with ~nix build .#android --impure~, and activate it with =result/activate=.
  743. #+BEGIN_SRC nix :noweb yes :tangle hosts/android/nix-on-droid.nix
  744. # <<file-warning>>
  745. { pkgs, ... }:
  746. {
  747. environment.packages = [
  748. pkgs.git
  749. pkgs.vim
  750. pkgs.pass
  751. pkgs.gnupg
  752. pkgs.openssh
  753. ];
  754. }
  755. #+END_SRC
  756. * Module Definitions
  757. 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.
  758. ** X11
  759. #+NAME: module-x11
  760. #+BEGIN_SRC nix
  761. ./modules/x11.nix
  762. #+END_SRC
  763. X11, or X[fn:30] is the generic name for the X Window System Display Server. All graphical GNU/Linux[fn:1] applications connect to an X-Window[fn:30] (or Wayland[fn:31]) 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.
  764. #+BEGIN_SRC nix :noweb yes :tangle modules/x11.nix
  765. # <<file-warning>>
  766. { config, pkgs, ... }:
  767. {
  768. services.xserver.enable = true;
  769. services.xserver.layout = "us";
  770. services.xserver.libinput.enable = true;
  771. services.xserver.displayManager.startx.enable = true;
  772. environment = {
  773. variables = {
  774. XDG_DESKTOP_DIR = "$HOME/";
  775. XDG_CACHE_HOME = "$HOME/.cache";
  776. XDG_CONFIG_HOME = "$HOME/.config";
  777. XDG_DATA_HOME = "$HOME/.local/share";
  778. XDG_BIN_HOME = "$HOME/.local/bin";
  779. };
  780. systemPackages = with pkgs; [
  781. pkgs.sqlite
  782. pkgs.pfetch
  783. pkgs.cmatrix
  784. pkgs.asciiquarium
  785. ];
  786. extraInit = ''
  787. export XAUTHORITY=/tmp/Xauthority
  788. export xserverauthfile=/tmp/xserverauth
  789. [ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY"
  790. [ -e ~/.serverauth.* ] && mv -f ~/.serverauth.* "$xserverauthfile"
  791. '';
  792. };
  793. services.picom.enable = true;
  794. services.printing.enable = true;
  795. fonts.fonts = with pkgs; [
  796. iosevka-bin
  797. emacs-all-the-icons-fonts
  798. ];
  799. }
  800. #+END_SRC
  801. ** SSH
  802. #+NAME: module-ssh
  803. #+BEGIN_SRC nix
  804. ./modules/ssh.nix
  805. #+END_SRC
  806. OpenSSH[fn:32] is a suite of secure networking utilities based on the Secure Shell Protocol, which provides a secure channel over an unsecured network in a client-server architecture. OpenSSH[fn:32] started as a fork of the free SSH program; later versions were proprietary software.
  807. Apply some configuration to the default settings:
  808. + Disable logging in as =root=
  809. + Disable password authentication
  810. #+BEGIN_SRC nix :noweb yes :tangle modules/ssh.nix
  811. # <<file-warning>>
  812. { config, pkgs, ... }:
  813. {
  814. services.openssh = {
  815. enable = true;
  816. permitRootLogin = "no";
  817. passwordAuthentication = false;
  818. };
  819. }
  820. #+END_SRC
  821. ** Hugo
  822. #+NAME: module-hugo
  823. #+BEGIN_SRC nix
  824. ./modules/hugo.nix
  825. #+END_SRC
  826. Hugo[fn:33] is one of the most popular open-source static site generators.
  827. #+BEGIN_SRC nix :noweb yes :tangle modules/hugo.nix
  828. # <<file-warning>>
  829. { config, pkgs, ... }:
  830. let
  831. myUpdateSite = pkgs.writeShellScriptBin "update-site" ''
  832. rsync -aP /etc/dotfiles/docs/public/ ubuntu@chrishayward.xyz:/var/www/chrishayward
  833. '';
  834. in {
  835. environment.systemPackages = [
  836. pkgs.hugo
  837. myUpdateSite
  838. ];
  839. }
  840. #+END_SRC
  841. ** Flakes
  842. #+NAME: module-flakes
  843. #+BEGIN_SRC nix
  844. ./modules/flakes.nix
  845. #+END_SRC
  846. Nix Flakes[fn:34] 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:34] 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:34] are not available unless explicitly enabled.
  847. #+BEGIN_SRC nix :noweb yes :tangle modules/flakes.nix
  848. # <<file-warning>>
  849. { config, pkgs, inputs, ... }:
  850. {
  851. nix = {
  852. package = pkgs.nixUnstable;
  853. extraOptions = ''
  854. experimental-features = nix-command flakes
  855. '';
  856. };
  857. nixpkgs = {
  858. config = { allowUnfree = true; };
  859. overlays = [ inputs.emacs-overlay.overlay ];
  860. };
  861. }
  862. #+END_SRC
  863. ** Cachix
  864. #+NAME: module-cachix
  865. #+BEGIN_SRC nix
  866. ./modules/cachix.nix
  867. #+END_SRC
  868. Cachix[fn:35] 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.
  869. #+BEGIN_SRC nix :noweb yes :tangle modules/cachix.nix
  870. # <<file-warning>>
  871. { config, ... }:
  872. {
  873. nix = {
  874. binaryCaches = [
  875. "https://nix-community.cachix.org"
  876. ];
  877. binaryCachePublicKeys = [
  878. "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
  879. ];
  880. };
  881. }
  882. #+END_SRC
  883. ** Docker
  884. #+NAME: module-docker
  885. #+BEGIN_SRC nix
  886. ./modules/docker.nix
  887. #+END_SRC
  888. Docker [fn:21] 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.
  889. #+BEGIN_SRC nix :noweb yes :tangle modules/docker.nix
  890. { config, pkgs, ... }:
  891. {
  892. # Enable the docker virutalization platform.
  893. virtualisation.docker = {
  894. enable = true;
  895. enableOnBoot = true;
  896. autoPrune.enable = true;
  897. };
  898. # Required for the `docker' command.
  899. users.users.chris.extraGroups = [ "docker" ];
  900. }
  901. #+END_SRC
  902. ** NVIDIA
  903. #+NAME: module-nvidia
  904. #+BEGIN_SRC nix
  905. ./modules/nvidia.nix
  906. #+END_SRC
  907. Use the ~lspci~ command to determine the type of graphics card you have, following the guide on NVIDIA at the NixOS Wiki[fn:36].
  908. #+BEGIN_QUOTE
  909. + MXM / output-providing card (shows as VGA Controller in lspci), i.e. graphics card in desktop computer or in some laptops
  910. + muxless/non-MXM Optimus cards have no display outputs and show as 3D Controller in lspci output, seen in most modern consumer laptops
  911. MXM cards allow you to use the Nvidia card standalone, in Non-Optimus mode. Non-MXM cards require Optimus, Nvidia's integrated-vs-discrete GPU switching technology.
  912. #+END_QUOTE
  913. Your output should look something like this:
  914. #+BEGIN_EXAMPLE
  915. ...
  916. 00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
  917. Subsystem: Acer Incorporated [ALI] Device 1264
  918. Kernel driver in use: i915
  919. Kernel modules: i915
  920. ...
  921. 01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
  922. Subsystem: Acer Incorporated [ALI] Device 1265
  923. Kernel driver in use: nouveau
  924. Kernel modules: nvidiafb, nouveau
  925. 01:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)
  926. Kernel driver in use: snd_hda_intel
  927. Kernel modules: snd_hda_intel
  928. ...
  929. #+END_EXAMPLE
  930. This reveals the information needed, which is the information about the two display cards in the laptop:
  931. + Intel UHD :: This is the dedicated graphics on the CPU
  932. + NVIDIA GP107M :: This is the /mobile/ version of the GTX 1050ti
  933. #+BEGIN_SRC nix :noweb yes :tangle modules/nvidia.nix
  934. { config, pkgs, ... }:
  935. let
  936. myIntelBusId = "PCI:0:2:0";
  937. myNvidiaBusId = "PCI:1:0:0";
  938. myNvidiaOffload = pkgs.writeShellScriptBin "nvidia-offload" ''
  939. export __NV_PRIME_RENDER_OFFLOAD=1
  940. export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
  941. export __GLX_VENDOR_LIBRARY_NAME=nvidia
  942. export __VK_LAYER_NV_optimus=NVIDIA_only
  943. exec -a "$0" "$@"
  944. '';
  945. in {
  946. # Add the offload script to the $PATH.
  947. environment.systemPackages = [ myNvidiaOffload ];
  948. # Configure XDG compliance.
  949. environment.variables = {
  950. __GL_SHADER_DISK_CACHE_PATH = "$XDG_CACHE_HOME/nv";
  951. CUDA_CACHE_PATH = "$XDG_CACHE_HOME/nv";
  952. };
  953. # Enable the NVIDIA drivers.
  954. services.xserver.videoDrivers = [ "nvidia" ];
  955. # Fix screen tearing.
  956. services.xserver.screenSection = ''
  957. Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
  958. Option "AllowIndirectGLXProtocol" "off"
  959. Option "TripleBuffer" "on"
  960. '';
  961. # Configure `offload-mode'.
  962. hardware.nvidia.prime = {
  963. offload.enable = true;
  964. intelBusId = myIntelBusId;
  965. nvidiaBusId = myNvidiaBusId;
  966. };
  967. # Add OpenGL support.
  968. hardware.opengl = {
  969. enable = true;
  970. driSupport32Bit = true;
  971. extraPackages32 = with pkgs; [
  972. pkgsi686Linux.libva
  973. ];
  974. };
  975. # Add user to video group.
  976. users.users.chris = {
  977. extraGroups = [ "video" ];
  978. };
  979. }
  980. #+END_SRC
  981. ** Firefox
  982. #+NAME: module-firefox
  983. #+BEGIN_SRC nix
  984. ./modules/firefox.nix
  985. #+END_SRC
  986. Firefox Browser[fn:37], 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.
  987. #+BEGIN_SRC nix :noweb yes :tangle modules/firefox.nix
  988. # <<file-warning>>
  989. { pkgs, ... }:
  990. {
  991. # NOTE: Use the binary until module is developed.
  992. environment.systemPackages = [
  993. pkgs.firefox-bin
  994. ];
  995. }
  996. #+END_SRC
  997. ** Jellyfin
  998. #+NAME: module-jellyfin
  999. #+BEGIN_SRC nix
  1000. ./modules/jellyfin.nix
  1001. #+END_SRC
  1002. Jellyfin[fn:38] 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.
  1003. #+BEGIN_SRC nix :noweb yes :tangle modules/jellyfin.nix
  1004. # <<file-warning>>
  1005. { config, pkgs, ... }:
  1006. {
  1007. services.jellyfin = {
  1008. enable = true;
  1009. };
  1010. }
  1011. #+END_SRC
  1012. ** Moonlight
  1013. #+NAME: module-moonlight
  1014. #+BEGIN_SRC nix
  1015. ./modules/moonlight.nix
  1016. #+END_SRC
  1017. Moonlight[fn:39] 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:39] is perfect for gaming on the go (or on GNU/Linux[fn:1]) without sacrificing the graphics and game selection available for the PC.
  1018. #+BEGIN_SRC nix :noweb yes :tangle modules/moonlight.nix
  1019. # <<file-warning>>
  1020. { pkgs, ... }:
  1021. {
  1022. environment.systemPackages = [
  1023. pkgs.moonlight-qt
  1024. ];
  1025. }
  1026. #+END_SRC
  1027. ** Teamviewer
  1028. #+NAME: module-teamviewer
  1029. #+BEGIN_SRC nix
  1030. ./modules/teamviewer.nix
  1031. #+END_SRC
  1032. The Teamviewer[fn:40] remote connectivity cloud platform enables secure remote access to any device, across platforms, from anywhere, anytime. Teamviewer[fn:40] 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.
  1033. #+BEGIN_SRC nix :noweb yes :tangle modules/teamviewer.nix
  1034. # <<file-warning>>
  1035. { pkgs, ... }:
  1036. {
  1037. # NOTE: Neither of these are working!
  1038. # services.teamviewer.enable = true;
  1039. # environment.systemPackages = [
  1040. # pkgs.teamviewer
  1041. # ];
  1042. }
  1043. #+END_SRC
  1044. ** Home Manager
  1045. 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.
  1046. #+NAME: module-home-manager
  1047. #+BEGIN_SRC nix :noweb yes
  1048. inputs.home-manager.nixosModules.home-manager {
  1049. home-manager.useGlobalPkgs = true;
  1050. home-manager.useUserPackages = true;
  1051. home-manager.users.chris = {
  1052. imports = [
  1053. <<module-git>>
  1054. <<module-gpg>>
  1055. <<module-vim>>
  1056. <<module-gtk>>
  1057. <<module-emacs>>
  1058. ];
  1059. };
  1060. }
  1061. #+END_SRC
  1062. *** Git
  1063. #+NAME: module-git
  1064. #+BEGIN_SRC nix
  1065. ./modules/git.nix
  1066. #+END_SRC
  1067. Git[fn:41] 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.
  1068. #+BEGIN_SRC nix :noweb yes :tangle modules/git.nix
  1069. # <<file-warning>>
  1070. { pkgs, ... }:
  1071. let
  1072. # Fix any corruptions in the local copy.
  1073. myGitFix = pkgs.writeShellScriptBin "git-fix" ''
  1074. if [ -d .git/objects/ ]; then
  1075. find .git/objects/ -type f -empty | xargs rm -f
  1076. git fetch -p
  1077. git fsck --full
  1078. fi
  1079. exit 1
  1080. '';
  1081. in {
  1082. home.packages = [ myGitFix ];
  1083. programs.git = {
  1084. enable = true;
  1085. userName = "Christopher James Hayward";
  1086. userEmail = "chris@chrishayward.xyz";
  1087. signing = {
  1088. key = "37AB1CB72B741E478CA026D43025DCBD46F81C0F";
  1089. signByDefault = true;
  1090. };
  1091. };
  1092. }
  1093. #+END_SRC
  1094. *** Gpg
  1095. #+NAME: module-gpg
  1096. #+BEGIN_SRC nix
  1097. ./modules/gpg.nix
  1098. #+END_SRC
  1099. GNU Privacy Guard[fn:42] 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.
  1100. #+BEGIN_SRC nix :noweb yes :tangle modules/gpg.nix
  1101. # <<file-warning>>
  1102. { pkgs, ... }:
  1103. {
  1104. services.gpg-agent = {
  1105. enable = true;
  1106. defaultCacheTtl = 1800;
  1107. enableSshSupport = true;
  1108. pinentryFlavor = "gtk2";
  1109. };
  1110. }
  1111. #+END_SRC
  1112. *** Vim
  1113. #+NAME: module-vim
  1114. #+BEGIN_SRC nix
  1115. ./modules/vim.nix
  1116. #+END_SRC
  1117. Neovim[fn:43] is a project that seeks to aggressively refactor Vim in order to:
  1118. + Simplify maintenance and encourage contributions
  1119. + Split the work between multiple developers
  1120. + Enable advanced UIs without core modification
  1121. + Maximize extensibility
  1122. #+BEGIN_SRC nix :noweb yes :tangle modules/vim.nix
  1123. # <<file-warning>>
  1124. { pkgs, ... }:
  1125. {
  1126. programs.neovim = {
  1127. enable = true;
  1128. viAlias = true;
  1129. vimAlias = true;
  1130. vimdiffAlias = true;
  1131. extraConfig = ''
  1132. set number relativenumber
  1133. set nobackup
  1134. '';
  1135. extraPackages = [
  1136. pkgs.nixfmt
  1137. ];
  1138. plugins = with pkgs.vimPlugins; [
  1139. vim-nix
  1140. vim-airline
  1141. vim-polyglot
  1142. ];
  1143. };
  1144. }
  1145. #+END_SRC
  1146. *** GTK
  1147. #+NAME: module-gtk
  1148. #+BEGIN_SRC nix
  1149. ./modules/gtk.nix
  1150. #+END_SRC
  1151. GTK[fn:44] 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:31] and X11[fn:30] windowing systems.
  1152. #+BEGIN_SRC nix :noweb yes :tangle modules/gtk.nix
  1153. # <<file-warning>>
  1154. { pkgs, ... }:
  1155. {
  1156. home.packages = [
  1157. pkgs.nordic
  1158. pkgs.arc-icon-theme
  1159. pkgs.lxappearance
  1160. ];
  1161. home.file.".gtkrc-2.0" = {
  1162. text = ''
  1163. # gtk-theme-name="Nordic-Polar"
  1164. gtk-theme-name="Nordic-darker"
  1165. gtk-icon-theme-name="Arc"
  1166. gtk-font-name="Sans 10"
  1167. gtk-cursor-theme-size=0
  1168. gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
  1169. gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
  1170. gtk-button-images=0
  1171. gtk-menu-images=0
  1172. gtk-enable-event-sounds=1
  1173. gtk-enable-input-feedback-sounds=1
  1174. gtk-xft-antialias=1
  1175. gtk-xft-hinting=1
  1176. gtk-xft-hintstyle="hintmedium"
  1177. '';
  1178. };
  1179. }
  1180. #+END_SRC
  1181. * Emacs Configuration
  1182. #+NAME: module-emacs
  1183. #+BEGIN_SRC nix
  1184. ./modules/emacs.nix
  1185. #+END_SRC
  1186. GNU/Emacs[fn:2] is an extensible, customizable, free/libre text editor -- and more. At its core is an interpreter for Emacs Lisp[fn:42], a dialect of the Lisp programming language with extensions to support text editing. Other features include:
  1187. + Highly customizable
  1188. + Full Unicopde support
  1189. + Content-aware editing modes
  1190. + Complete built-in documentation
  1191. + Wide range of functionality beyond text editing
  1192. #+BEGIN_SRC nix :noweb yes :tangle modules/emacs.nix
  1193. # <<file-warning>>
  1194. { pkgs, ... }:
  1195. let
  1196. myEmacs = pkgs.emacsWithPackagesFromUsePackage {
  1197. config = ../README.org;
  1198. package = <<emacs-native-comp-package>>
  1199. alwaysEnsure = true;
  1200. alwaysTangle = true;
  1201. extraEmacsPackages = epkgs: [
  1202. # Required packages...
  1203. <<emacs-exwm-package>>
  1204. <<emacs-evil-package>>
  1205. <<emacs-general-package>>
  1206. <<emacs-which-key-package>>
  1207. # Optional packages.
  1208. <<emacs-org-package>>
  1209. <<emacs-org-roam-package>>
  1210. <<emacs-org-drill-package>>
  1211. <<emacs-pomodoro-package>>
  1212. <<emacs-writegood-package>>
  1213. <<emacs-http-package>>
  1214. <<emacs-hugo-package>>
  1215. <<emacs-reveal-package>>
  1216. <<emacs-pass-package>>
  1217. <<emacs-docker-package>>
  1218. <<emacs-mu4e-package>>
  1219. <<emacs-dired-package>>
  1220. <<emacs-icons-package>>
  1221. <<emacs-emoji-package>>
  1222. <<emacs-eshell-package>>
  1223. <<emacs-vterm-package>>
  1224. <<emacs-magit-package>>
  1225. <<emacs-fonts-package>>
  1226. <<emacs-elfeed-package>>
  1227. <<emacs-nix-mode-package>>
  1228. <<emacs-projectile-package>>
  1229. <<emacs-lsp-package>>
  1230. <<emacs-company-package>>
  1231. <<emacs-ccls-package>>
  1232. <<emacs-golang-package>>
  1233. <<emacs-python-package>>
  1234. <<emacs-rustic-package>>
  1235. <<emacs-plantuml-package>>
  1236. <<emacs-protobuf-package>>
  1237. <<emacs-swiper-package>>
  1238. <<emacs-desktop-package>>
  1239. <<emacs-doom-themes-package>>
  1240. <<emacs-doom-modeline-package>>
  1241. ];
  1242. };
  1243. in {
  1244. home.packages = [
  1245. <<emacs-exwm-extras>>
  1246. <<emacs-pass-extras>>
  1247. <<emacs-mu4e-extras>>
  1248. <<emacs-aspell-extras>>
  1249. <<emacs-texlive-extras>>
  1250. <<emacs-desktop-extras>>
  1251. <<emacs-plantuml-extras>>
  1252. <<emacs-nix-mode-extras>>
  1253. ];
  1254. programs.emacs = {
  1255. enable = true;
  1256. package = myEmacs;
  1257. };
  1258. <<emacs-exwm-config>>
  1259. <<emacs-exwm-xinitrc>>
  1260. <<emacs-mu4e-config>>
  1261. }
  1262. #+END_SRC
  1263. 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.
  1264. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/init.el
  1265. ;; <<file-warning>>
  1266. ;; Required inputs.
  1267. <<emacs-exwm-elisp>>
  1268. <<emacs-evil-elisp>>
  1269. <<emacs-general-elisp>>
  1270. <<emacs-which-key-elisp>>
  1271. ;; Optional inputs.
  1272. <<emacs-org-elisp>>
  1273. <<emacs-org-roam-elisp>>
  1274. <<emacs-org-drill-elisp>>
  1275. <<emacs-org-agenda-elisp>>
  1276. <<emacs-pomodoro-elisp>>
  1277. <<emacs-writegood-elisp>>
  1278. <<emacs-aspell-elisp>>
  1279. <<emacs-eww-elisp>>
  1280. <<emacs-http-elisp>>
  1281. <<emacs-hugo-elisp>>
  1282. <<emacs-reveal-elisp>>
  1283. <<emacs-pass-elisp>>
  1284. <<emacs-docker-elisp>>
  1285. <<emacs-erc-elisp>>
  1286. <<emacs-mu4e-elisp>>
  1287. <<emacs-dired-elisp>>
  1288. <<emacs-icons-elisp>>
  1289. <<emacs-emoji-elisp>>
  1290. <<emacs-eshell-elisp>>
  1291. <<emacs-vterm-elisp>>
  1292. <<emacs-magit-elisp>>
  1293. <<emacs-fonts-elisp>>
  1294. <<emacs-elfeed-elisp>>
  1295. <<emacs-projectile-elisp>>
  1296. <<emacs-lsp-elisp>>
  1297. <<emacs-company-elisp>>
  1298. <<emacs-golang-elisp>>
  1299. <<emacs-python-elisp>>
  1300. <<emacs-rustic-elisp>>
  1301. <<emacs-plantuml-elisp>>
  1302. <<emacs-desktop-elisp>>
  1303. ;; User interface.
  1304. <<emacs-swiper-elisp>>
  1305. <<emacs-transparency-elisp>>
  1306. <<emacs-doom-themes-elisp>>
  1307. <<emacs-doom-modeline-elisp>>
  1308. #+END_SRC
  1309. 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=.
  1310. #+BEGIN_SRC emacs-lisp :noweb yes :tangle ~/.emacs.d/early-init.el
  1311. ;; <<file-warning>>
  1312. <<emacs-disable-ui-elisp>>
  1313. <<emacs-native-comp-elisp>>
  1314. <<emacs-backup-files-elisp>>
  1315. <<emacs-shell-commands-elisp>>
  1316. #+END_SRC
  1317. ** Native Comp
  1318. #+NAME: emacs-native-comp-package
  1319. #+BEGIN_SRC nix
  1320. pkgs.emacsGcc;
  1321. #+END_SRC
  1322. 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.
  1323. #+NAME: emacs-native-comp-elisp
  1324. #+BEGIN_SRC emacs-lisp
  1325. ;; Silence warnings from packages that don't support `native-comp'.
  1326. (setq comp-async-report-warnings-errors nil ;; Emacs 27.2 ...
  1327. native-comp-async-report-warnings-errors nil) ;; Emacs 28+ ...
  1328. #+END_SRC
  1329. ** Disable UI
  1330. 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.
  1331. #+NAME: emacs-disable-ui-elisp
  1332. #+BEGIN_SRC emacs-lisp
  1333. ;; Disable unwanted UI elements.
  1334. (tooltip-mode -1)
  1335. (menu-bar-mode -1)
  1336. (tool-bar-mode -1)
  1337. (scroll-bar-mode -1)
  1338. ;; Fix the scrolling behaviour.
  1339. (setq scroll-conservatively 101)
  1340. ;; Fix mouse-wheel scrolling behaviour.
  1341. (setq mouse-wheel-follow-mouse t
  1342. mouse-wheel-progressive-speed t
  1343. mouse-wheel-scroll-amount '(3 ((shift) . 3)))
  1344. ;; Start in fullscreen/maximized.
  1345. (add-to-list 'default-frame-alist '(fullscreen . maximized))
  1346. #+END_SRC
  1347. ** Backup Files
  1348. 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.
  1349. #+NAME: emacs-backup-files-elisp
  1350. #+BEGIN_SRC emacs-lisp
  1351. ;; Disable unwanted features.
  1352. (setq make-backup-files nil
  1353. create-lockfiles nil)
  1354. #+END_SRC
  1355. ** Shell Commands
  1356. Define some methods for interaction between GNU/Emacs[fn:2], and the systems underyling shell:
  1357. 1) Method to run an external process, launching any application on a new process without interferring with Emacs[fn:2]
  1358. 2) Method to apply commands to the curren call process, effecting the running instance of Emacs[fn:2]
  1359. #+NAME: emacs-shell-commands-elisp
  1360. #+BEGIN_SRC emacs-lisp
  1361. ;; Define a method to run an external process.
  1362. (defun dotfiles/run (cmd)
  1363. "Run an external process."
  1364. (interactive (list (read-shell-command "λ ")))
  1365. (start-process-shell-command cmd nil cmd))
  1366. ;; Define a method to run a background process.
  1367. (defun dotfiles/run-in-background (cmd)
  1368. (let ((command-parts (split-string cmd "[ ]+")))
  1369. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  1370. #+END_SRC
  1371. ** Nix Mode
  1372. #+NAME: emacs-nix-mode-extras
  1373. #+BEGIN_SRC nix
  1374. pkgs.nixfmt
  1375. #+END_SRC
  1376. Nix-mode[fn:45] 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.
  1377. #+NAME: emacs-nix-mode-package
  1378. #+BEGIN_SRC nix
  1379. epkgs.nix-mode
  1380. #+END_SRC
  1381. ** Evil Mode
  1382. Evil[fn:46] is an extensible VI layer for GNU/Emacs[fn:2]. It emulates the main features of Vim[fn:43], turning GNU/Emacs[fn:2] into a modal editor.
  1383. #+NAME: emacs-evil-package
  1384. #+BEGIN_SRC nix
  1385. epkgs.evil
  1386. epkgs.evil-collection
  1387. epkgs.evil-surround
  1388. epkgs.evil-nerd-commenter
  1389. #+END_SRC
  1390. 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:46] is extensible in Emacs Lisp[fn:42].
  1391. #+NAME: emacs-evil-elisp
  1392. #+BEGIN_SRC emacs-lisp
  1393. ;; Enable the Extensible VI Layer for Emacs.
  1394. (setq evil-want-integration t ;; Required for `evil-collection.'
  1395. evil-want-keybinding nil) ;; Same as above.
  1396. (evil-mode +1)
  1397. ;; Configure `evil-collection'.
  1398. (evil-collection-init)
  1399. ;; Configure `evil-surround'.
  1400. (global-evil-surround-mode +1)
  1401. ;; Configure `evil-nerd-commenter'.
  1402. (global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
  1403. #+END_SRC
  1404. ** EXWM
  1405. #+NAME: emacs-exwm-package
  1406. #+BEGIN_SRC nix
  1407. epkgs.exwm
  1408. #+END_SRC
  1409. EXWM (Emacs X Window Manager)[fn:25] is a full-featured tiling X window manager for GNU/Emacs[fn:2] built on-top of XELB. It features:
  1410. + Fully keyboard-driven operations
  1411. + Hybrid layout modes (tiling & stacking)
  1412. + Dynamic workspace support
  1413. + ICCM/EWMH compliance
  1414. #+NAME: emacs-exwm-extras
  1415. #+BEGIN_SRC nix
  1416. pkgs.nitrogen
  1417. pkgs.autorandr
  1418. #+END_SRC
  1419. 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:25].
  1420. #+NAME: emacs-exwm-config
  1421. #+BEGIN_SRC nix
  1422. xsession = {
  1423. enable = true;
  1424. windowManager.command = ''
  1425. ${pkgs.nitrogen}/bin/nitrogen --restore
  1426. ${myEmacs}/bin/emacs --daemon -f exwm-enable
  1427. ${myEmacs}/bin/emacsclient -c
  1428. '';
  1429. };
  1430. #+END_SRC
  1431. EXWM[fn:25] 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=.
  1432. #+NAME: emacs-exwm-xinitrc
  1433. #+BEGIN_SRC nix
  1434. home.file.".xinitrc" = {
  1435. text = ''
  1436. exec ./.xsession
  1437. '';
  1438. };
  1439. #+END_SRC
  1440. #+NAME: emacs-exwm-elisp
  1441. #+BEGIN_SRC emacs-lisp
  1442. ;; Configure `exwm'.
  1443. (setq exwm-layout-show-all-buffers t
  1444. exwm-worspace-show-all-buffers t)
  1445. ;; Configure input keys.
  1446. (setq exwm-input-prefix-keys
  1447. '(?\M-x
  1448. ?\C-g
  1449. ?\C-\ ))
  1450. (setq exwm-input-global-keys
  1451. `(([?\s-r] . exwm-reset)
  1452. ,@(mapcar (lambda (i)
  1453. `(,(kbd (format "s-%d" i)) .
  1454. (lambda ()
  1455. (interactive)
  1456. (exwm-workspace-switch-create ,i))))
  1457. (number-sequence 0 9))))
  1458. ;; Configure `exwm-randr'.
  1459. (require 'exwm-randr)
  1460. (exwm-randr-enable)
  1461. ;; Configure custom hooks.
  1462. (setq display-time-day-and-date t)
  1463. (add-hook 'exwm-init-hook
  1464. (lambda ()
  1465. (display-battery-mode +1) ;; Display battery info (if available).
  1466. (display-time-mode +1))) ;; Display the time in the modeline.
  1467. ;; Setup buffer display names.
  1468. (add-hook 'exwm-update-class-hook
  1469. (lambda ()
  1470. (exwm-workspace-rename-buffer exwm-class-name))) ;; Use the system class name.
  1471. ;; Configure monitor hot-swapping.
  1472. (add-hook 'exwm-randr-screen-change-hook
  1473. (lambda ()
  1474. (dotfiles/run-in-background "autorandr --change --force"))) ;; Swap to the next screen config.
  1475. #+END_SRC
  1476. ** General
  1477. #+NAME: emacs-general-package
  1478. #+BEGIN_SRC nix
  1479. epkgs.general
  1480. #+END_SRC
  1481. General[fn:47] 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.
  1482. #+NAME: emacs-general-elisp
  1483. #+BEGIN_SRC emacs-lisp
  1484. ;; Use <SPC> as a leader key via `general.el'.
  1485. (general-create-definer dotfiles/leader
  1486. :states '(normal motion)
  1487. :keymaps 'override
  1488. :prefix "SPC"
  1489. :global-prefix "C-SPC")
  1490. ;; Find files with <SPC> <period> ...
  1491. ;; Switch buffers with <SPC> <comma> ...
  1492. (dotfiles/leader
  1493. "." '(find-file :which-key "File")
  1494. "," '(switch-to-buffer :which-key "Buffer")
  1495. "k" '(kill-buffer :which-key "Kill")
  1496. "c" '(kill-buffer-and-window :which-key "Close"))
  1497. ;; Add keybindings for executing shell commands.
  1498. (dotfiles/leader
  1499. "r" '(:ignore t :which-key "Run")
  1500. "rr" '(dotfiles/run :which-key "Run")
  1501. "ra" '(async-shell-command :which-key "Async"))
  1502. ;; Add keybindings for quitting Emacs.
  1503. (dotfiles/leader
  1504. "q" '(:ignore t :which-key "Quit")
  1505. "qq" '(save-buffers-kill-emacs :which-key "Save")
  1506. "qw" '(kill-emacs :which-key "Now")
  1507. "qf" '(delete-frame :which-key "Frame"))
  1508. ;; Add keybindings for toggles / tweaks.
  1509. (dotfiles/leader
  1510. "t" '(:ignore t :which-key "Toggle / Tweak"))
  1511. ;; Add keybindings for working with frames to replace
  1512. ;; the C-x <num> <num> method of bindings, which is awful.
  1513. (dotfiles/leader
  1514. "w" '(:ignore t :which-key "Windows")
  1515. "ww" '(window-swap-states :which-key "Swap")
  1516. "wc" '(delete-window :which-key "Close")
  1517. "wh" '(windmove-left :which-key "Left")
  1518. "wj" '(windmove-down :which-key "Down")
  1519. "wk" '(windmove-up :which-key "Up")
  1520. "wl" '(windmove-right :which-key "Right")
  1521. "ws" '(:ignore t :which-key "Split")
  1522. "wsj" '(split-window-below :which-key "Below")
  1523. "wsl" '(split-window-right :which-key "Right"))
  1524. #+END_SRC
  1525. ** Which Key
  1526. Which-key[fn:48] 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.
  1527. #+NAME: emacs-which-key-package
  1528. #+BEGIN_SRC nix
  1529. epkgs.which-key
  1530. #+END_SRC
  1531. #+NAME: emacs-which-key-elisp
  1532. #+BEGIN_SRC emacs-lisp
  1533. ;; Configure `which-key' to see keyboard bindings in the
  1534. ;; mini-buffer and when using M-x.
  1535. (setq which-key-idle-delay 0.0)
  1536. (which-key-mode +1)
  1537. #+END_SRC
  1538. ** EWW
  1539. The Emacs Web Wowser[fn:49] is a Web browser written in Emacs Lisp[fn:42] based on the ~shr.el~ library. It's my primary browser when it comes to text-based browsing.
  1540. + Use ~eww~ as the default browser
  1541. + Don't use any special fonts or colours
  1542. #+NAME: emacs-eww-elisp
  1543. #+BEGIN_SRC emacs-lisp
  1544. ;; Set `eww' as the default browser.
  1545. (setq browse-url-browser-function 'eww-browse-url)
  1546. ;; Configure the `shr' rendering engine.
  1547. (setq shr-use-fonts nil
  1548. shr-use-colors nil)
  1549. #+END_SRC
  1550. ** ERC
  1551. ERC[fn:50] is a powerful, modular, and extensible IRC client for GNU/Emacs[fn:2]. It's part of the GNU project, and included in Emacs.
  1552. #+NAME: emacs-erc-elisp
  1553. #+BEGIN_SRC emacs-lisp
  1554. ;; Configure `erc'.
  1555. (setq erc-autojoin-channels-alist '(("irc.libera.chat" "#emacs" "#nixos" "#org-mode" "#systemcrafters"))
  1556. erc-track-exclude-types '("JOIN" "NICK" "QUIT" "MODE")
  1557. erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
  1558. ;; Configure `erc-fill-column'.
  1559. (add-hook 'window-configuration-change-hook
  1560. '(lambda ()
  1561. (setq erc-fill-column (- (window-width) 12))))
  1562. ;; Connect to IRC via `erc'.
  1563. (defun dotfiles/erc-connect ()
  1564. "Connected to IRC via `erc'."
  1565. (interactive)
  1566. (erc-tls :server "irc.libera.chat"
  1567. :port 6697
  1568. :nick "megaphone"
  1569. :password (password-store-get "megaphone@libera.chat")
  1570. :full-name "Chris Hayward"))
  1571. ;; Configure keybindings.
  1572. (dotfiles/leader
  1573. "i" '(dotfiles/erc-connect :which-key "Chat"))
  1574. #+END_SRC
  1575. ** Dired
  1576. #+NAME: emacs-dired-package
  1577. #+BEGIN_SRC nix
  1578. epkgs.dired-single
  1579. #+END_SRC
  1580. Dired[fn:51] 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:52] provides extra functionality for Dired[fn:51].
  1581. #+NAME: emacs-dired-elisp
  1582. #+BEGIN_SRC emacs-lisp
  1583. ;; Include `dired-x' for the `jump' method.
  1584. (require 'dired-x)
  1585. ;; Configure `dired-single' to support `evil' keys.
  1586. (evil-collection-define-key 'normal 'dired-mode-map
  1587. "h" 'dired-single-up-directory
  1588. "l" 'dired-single-buffer)
  1589. ;; Setup `all-the-icons' and the `dired' extension.
  1590. ;; Configure keybindings for `dired'.
  1591. (dotfiles/leader
  1592. "d" '(dired-jump :which-key "Dired"))
  1593. #+END_SRC
  1594. ** Icons
  1595. #+NAME: emacs-icons-package
  1596. #+BEGIN_SRC nix
  1597. epkgs.all-the-icons
  1598. epkgs.all-the-icons-dired
  1599. #+END_SRC
  1600. All The Icons[fn:53] is a utility package to collect various Icon Fonts and prioritize them within GNU/Emacs[fn:2].
  1601. #+NAME: emacs-icons-elisp
  1602. #+BEGIN_SRC emacs-lisp
  1603. ;; Setup `all-the-icons-dired'.
  1604. (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
  1605. ;; Display default font ligatures.
  1606. (global-prettify-symbols-mode +1)
  1607. #+END_SRC
  1608. ** Emojis
  1609. #+NAME: emacs-emoji-package
  1610. #+BEGIN_SRC nix
  1611. epkgs.emojify
  1612. #+END_SRC
  1613. Emojify[fn:54] 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.
  1614. #+NAME: emacs-emoji-elisp
  1615. #+BEGIN_SRC emacs-lisp
  1616. ;; Setup `emojify'.
  1617. (add-hook 'after-init-hook 'global-emojify-mode)
  1618. #+END_SRC
  1619. ** EShell
  1620. #+NAME: emacs-eshell-package
  1621. #+BEGIN_SRC nix
  1622. epkgs.eshell-prompt-extras
  1623. #+END_SRC
  1624. EShell [fn:55] is a shell-like command interpreter for GNU/Emacs[fn:2] implemented in Emacs Lisp[fn:42]. 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].
  1625. #+NAME: emacs-eshell-elisp
  1626. #+BEGIN_SRC emacs-lisp
  1627. ;; Configure `eshell'.
  1628. (setq eshell-highlight-prompt nil
  1629. eshell-prefer-lisp-functions nil)
  1630. ;; Configure the lambda prompt.
  1631. (autoload 'epe-theme-lambda "eshell-prompt-extras")
  1632. (setq eshell-prompt-function 'epe-theme-lambda)
  1633. ;; Configure keybindings for `eshell'.
  1634. (dotfiles/leader
  1635. "e" '(eshell :which-key "EShell"))
  1636. #+END_SRC
  1637. ** VTerm
  1638. Emacs Libvterm (VTerm)[fn:56] is a fully-fledged terminal emulator inside GNU/Emacs[fn:2] based on Libvterm[fn:57], a blazing fast C library used in Neovim[fn:43]. As a result of using compiled code (instead of Emacs Lisp[fn:42]), VTerm[fn:56] is capable, fast, and it can seamlessly handle large outputs.
  1639. #+NAME: emacs-vterm-package
  1640. #+BEGIN_SRC nix
  1641. epkgs.vterm
  1642. #+END_SRC
  1643. #+NAME: emacs-vterm-elisp
  1644. #+BEGIN_SRC emacs-lisp
  1645. ;; Add keybindings for interacting with the shell(s).
  1646. (dotfiles/leader
  1647. "v" '(vterm :which-key "VTerm"))
  1648. #+END_SRC
  1649. ** Magit
  1650. Magit[fn:58] is an interface to the Git[fn:41] version control system, implemented as a GNU/Emacs[fn:2] package written in Elisp[fn:42]. It fills the glaring gap between the Git[fn:41] command line interface and various GUIs, letting you perform trivial as well as elaborate version control tasks within a few mnemonic key presses.
  1651. #+NAME: emacs-magit-package
  1652. #+BEGIN_SRC nix
  1653. epkgs.magit
  1654. #+END_SRC
  1655. #+NAME: emacs-magit-elisp
  1656. #+BEGIN_SRC emacs-lisp
  1657. ;; Add keybindings for working with `magit'.
  1658. (dotfiles/leader
  1659. "g" '(:ignore t :which-key "Git")
  1660. "gg" '(magit-status :which-key "Status")
  1661. "gc" '(magit-clone :which-key "Clone")
  1662. "gf" '(magit-fetch :which-key "Fetch")
  1663. "gp" '(magit-pull :which-key "Pull"))
  1664. #+END_SRC
  1665. ** Fonts
  1666. #+NAME: emacs-fonts-package
  1667. #+BEGIN_SRC nix
  1668. epkgs.hydra
  1669. #+END_SRC
  1670. #+NAME: emacs-fonts-elisp
  1671. #+BEGIN_SRC emacs-lisp
  1672. ;; Configure the font when running as `emacs-server'.
  1673. (custom-set-faces
  1674. '(default ((t (:inherit nil :height 120 :family "Iosevka")))))
  1675. ;; Set all three of Emacs' font faces.
  1676. ;; NOTE: This only works without `emacs-server'.
  1677. ;; (set-face-attribute 'default nil :font "Iosevka" :height 96)
  1678. ;; (set-face-attribute 'fixed-pitch nil :font "Iosevka" :height 96)
  1679. ;; (set-face-attribute 'variable-pitch nil :font "Iosevka" :height 96)
  1680. ;; Define a `hydra' function for scaling the text interactively.
  1681. (defhydra hydra-text-scale (:timeout 4)
  1682. "Scale text"
  1683. ("j" text-scale-decrease "Decrease")
  1684. ("k" text-scale-increase "Increase")
  1685. ("f" nil "Finished" :exit t))
  1686. ;; Create keybinding for calling the function.
  1687. (dotfiles/leader
  1688. "tf" '(hydra-text-scale/body :which-key "Font"))
  1689. #+END_SRC
  1690. ** Elfeed
  1691. #+NAME: emacs-elfeed-package
  1692. #+BEGIN_SRC nix
  1693. epkgs.elfeed
  1694. #+END_SRC
  1695. Elfeed[fn:59] 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.
  1696. #+NAME: emacs-elfeed-elisp
  1697. #+BEGIN_SRC emacs-lisp
  1698. ;; Configure `elfeed'.
  1699. (setq elfeed-db-directory (expand-file-name "~/.cache/elfeed"))
  1700. ;; Add custom feeds for `elfeed' to fetch.
  1701. (setq elfeed-feeds (quote
  1702. (("https://hexdsl.co.uk/rss.xml")
  1703. ("https://lukesmith.xyz/rss.xml")
  1704. ("https://friendo.monster/rss.xml")
  1705. ("https://chrishayward.xyz/index.xml")
  1706. ("https://protesilaos.com/master.xml"))))
  1707. ;; Add custom keybindings for `elfeed'.
  1708. (dotfiles/leader
  1709. "l" '(:ignore t :which-key "Elfeed")
  1710. "ll" '(elfeed :which-key "Open")
  1711. "lu" '(elfeed-update :which-key "Update"))
  1712. #+END_SRC
  1713. ** Org Mode
  1714. #+NAME: emacs-org-package
  1715. #+BEGIN_SRC nix
  1716. epkgs.org
  1717. #+END_SRC
  1718. Org-mode[fn:60] 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.
  1719. #+NAME: emacs-org-elisp
  1720. #+BEGIN_SRC emacs-lisp
  1721. ;; Configure `org-mode' source blocks.
  1722. (setq org-src-fontify-natively t ;; Make source blocks prettier.
  1723. org-src-tab-acts-natively t ;; Use TAB indents within source blocks.
  1724. org-src-preserve-indentation t ;; Stop `org-mode' from formatting blocks.
  1725. org-confirm-babel-evaluate nil) ;; Don't ask for confirmation to evaluate blocks.
  1726. ;; Add an `org-mode-hook'.
  1727. (add-hook 'org-mode-hook
  1728. (lambda ()
  1729. (org-indent-mode)
  1730. (visual-line-mode)))
  1731. ;; Remove the `Validate XHTML 1.0' message from HTML export.
  1732. (setq org-export-html-validation-link nil
  1733. org-html-validation-link nil)
  1734. ;; Configure the keywords in the TODO -> DONE sequence.
  1735. (setq org-todo-keywords '((sequence "TODO" "START" "WAIT" "DONE")))
  1736. ;; Configure `org-babel' languages.
  1737. (org-babel-do-load-languages
  1738. 'org-babel-load-languages
  1739. '((C . t)))
  1740. ;; Log / Clock into property drawers.
  1741. (setq org-log-into-drawer t
  1742. org-clock-into-drawer t)
  1743. ;; TODO: Configure default structure templates.
  1744. ;; (require 'org-tempo)
  1745. ;; Apply custom keybindings.
  1746. (dotfiles/leader
  1747. "o" '(:ignore t :which-key "Org")
  1748. "oe" '(org-export-dispatch :which-key "Export")
  1749. "ot" '(org-babel-tangle :which-key "Tangle")
  1750. "oi" '(org-toggle-inline-images :which-key "Images")
  1751. "of" '(:ignore t :which-key "Footnotes")
  1752. "ofn" '(org-footnote-normalize :which-key "Normalize"))
  1753. #+END_SRC
  1754. ** Org Roam
  1755. #+NAME: emacs-org-roam-package
  1756. #+BEGIN_SRC nix
  1757. epkgs.org-roam
  1758. #+END_SRC
  1759. Org Roam[fn:61] is a plain-text knowledge management system. It borrows principles from the Zettelkasten method[fn:62], 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:60] for their personal wiki (me). Org Roam Server[fn:63] is a Web application to visualize the Org Roam[fn:61] 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.
  1760. #+NAME: emacs-org-roam-elisp
  1761. #+BEGIN_SRC emacs-lisp
  1762. ;; Setup `org-roam'.
  1763. (require 'org-roam)
  1764. (add-hook 'after-init-hook
  1765. (lambda ()
  1766. (org-roam-setup)))
  1767. ;; Silence the migration warnings.
  1768. (setq org-roam-v2-ack t
  1769. org-id-track-globally t)
  1770. ;; Update ids globally.
  1771. ;; Set the roam directories.
  1772. (setq org-roam-directory (expand-file-name "/etc/dotfiles")
  1773. org-roam-dailies-directory (concat org-roam-directory "/docs/daily"))
  1774. ;; Clear the deafult capture templates.
  1775. (setq org-roam-capture-templates '()
  1776. org-roam-dailies-capture-templates '())
  1777. ;; Encrypt files with the public key.
  1778. (setq epa-file-select-keys 2
  1779. epa-file-encrypt-to "37AB1CB72B741E478CA026D43025DCBD46F81C0F"
  1780. epa-cache-passphrase-for-symmetric-encryption t)
  1781. ;; Override the default slug method.
  1782. (cl-defmethod org-roam-node-slug ((node org-roam-node))
  1783. (let ((title (org-roam-node-title node))
  1784. (slug-trim-chars '(768 ; U+0300 COMBINING GRAVE ACCENT
  1785. 769 ; U+0301 COMBINING ACUTE ACCENT
  1786. 770 ; U+0302 COMBINING CIRCUMFLEX ACCENT
  1787. 771 ; U+0303 COMBINING TILDE
  1788. 772 ; U+0304 COMBINING MACRON
  1789. 774 ; U+0306 COMBINING BREVE
  1790. 775 ; U+0307 COMBINING DOT ABOVE
  1791. 776 ; U+0308 COMBINING DIAERESIS
  1792. 777 ; U+0309 COMBINING HOOK ABOVE
  1793. 778 ; U+030A COMBINING RING ABOVE
  1794. 780 ; U+030C COMBINING CARON
  1795. 795 ; U+031B COMBINING HORN
  1796. 803 ; U+0323 COMBINING DOT BELOW
  1797. 804 ; U+0324 COMBINING DIAERESIS BELOW
  1798. 805 ; U+0325 COMBINING RING BELOW
  1799. 807 ; U+0327 COMBINING CEDILLA
  1800. 813 ; U+032D COMBINING CIRCUMFLEX ACCENT BELOW
  1801. 814 ; U+032E COMBINING BREVE BELOW
  1802. 816 ; U+0330 COMBINING TILDE BELOW
  1803. 817 ; U+0331 COMBINING MACRON BELOW
  1804. )))
  1805. (cl-flet* ((nonspacing-mark-p (char)
  1806. (memq char slug-trim-chars))
  1807. (strip-nonspacing-marks (s)
  1808. (ucs-normalize-NFC-string
  1809. (apply #'string (seq-remove #'nonspacing-mark-p
  1810. (ucs-normalize-NFD-string s)))))
  1811. (cl-replace (title pair)
  1812. (replace-regexp-in-string (car pair) (cdr pair) title)))
  1813. (let* ((pairs `(("[^[:alnum:][:digit:]]" . "-")
  1814. ("--*" . "-")
  1815. ("^-" . "")
  1816. ("-$" . "")))
  1817. (slug (-reduce-from #'cl-replace (strip-nonspacing-marks title) pairs)))
  1818. (downcase slug)))))
  1819. ;; Configure capture templates.
  1820. ;; Standard document.
  1821. (add-to-list 'org-roam-capture-templates
  1822. '("d" "Default" plain "%?"
  1823. :target (file+head "docs/%<%Y%m%d%H%M%S>-${slug}.org.gpg"
  1824. "
  1825. ,#+TITLE: ${title}
  1826. ,#+AUTHOR: Christopher James Hayward
  1827. ,#+EMAIL: chris@chrishayward.xyz
  1828. "
  1829. )
  1830. :unnarrowed t))
  1831. ;; Daily notes.
  1832. (add-to-list 'org-roam-dailies-capture-templates
  1833. '("d" "Default" entry "* %?"
  1834. :target (file+head "%<%Y-%m-%d>.org.gpg"
  1835. "
  1836. ,#+TITLE: %<%Y-%m-%d>
  1837. ,#+AUTHOR: Christopher James Hayward
  1838. ,#+EMAIL: chris@chrishayward.xyz
  1839. ")))
  1840. ;; Apply custom keybindings.
  1841. (dotfiles/leader
  1842. "or" '(:ignore t :which-key "Roam")
  1843. "ori" '(org-roam-node-insert :which-key "Insert")
  1844. "orf" '(org-roam-node-find :which-key "Find")
  1845. "orc" '(org-roam-capture :which-key "Capture")
  1846. "orb" '(org-roam-buffer-toggle :which-key "Buffer"))
  1847. ;; Apply custom keybindings for dailies.
  1848. (dotfiles/leader
  1849. "ord" '(:ignore t :which-key "Dailies")
  1850. "ordd" '(org-roam-dailies-goto-date :which-key "Date")
  1851. "ordt" '(org-roam-dailies-goto-today :which-key "Today")
  1852. "ordm" '(org-roam-dailies-goto-tomorrow :which-key "Tomorrow")
  1853. "ordy" '(org-roam-dailies-goto-yesterday :which-key "Yesterday"))
  1854. #+END_SRC
  1855. ** Org Drill
  1856. #+NAME: emacs-org-drill-package
  1857. #+BEGIN_SRC nix
  1858. epkgs.org-drill
  1859. #+END_SRC
  1860. Org Drill[fn:64] is an extension for Org Mode[fn:60] that uses a spaced repition algorithm to conduct interactive /Drill Sessions/ using Org files as sources of facts to be memorized.
  1861. #+NAME: emacs-org-drill-elisp
  1862. #+BEGIN_SRC emacs-lisp
  1863. ;; Exclude :drill: items from `org-roam'.
  1864. (setq org-roam-db-node-include-function
  1865. (defun dotfiles/org-roam-include ()
  1866. (not (member "drill" (org-get-tags)))))
  1867. ;; Configure keybindings for `org-drill'.
  1868. (dotfiles/leader
  1869. "od" '(:ignore t :which-key "Drill")
  1870. "odd" '(org-drill :which-key "Drill")
  1871. "odc" '(org-drill-cram :which-key "Cram")
  1872. "odr" '(org-drill-resume :which-key "Resume"))
  1873. #+END_SRC
  1874. ** Org Agenda
  1875. The way Org Mode[fn:60] 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.
  1876. #+NAME: emacs-org-agenda-elisp
  1877. #+BEGIN_SRC emacs-lisp
  1878. ;; Configure `org-agenda' to use the project files.
  1879. (setq org-agenda-files '("/etc/dotfiles/"
  1880. "/etc/dotfiles/docs/"
  1881. "/etc/dotfiles/docs/daily/"))
  1882. ;; Include files encrypted with `gpg'.
  1883. (require 'org)
  1884. (unless (string-match-p "\\.gpg" org-agenda-file-regexp)
  1885. (setq org-agenda-file-regexp
  1886. (replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?"
  1887. org-agenda-file-regexp)))
  1888. ;; Open an agenda buffer with SPC o a.
  1889. (dotfiles/leader
  1890. "oa" '(org-agenda :which-key "Agenda"))
  1891. #+END_SRC
  1892. ** Org Pomodoro
  1893. #+NAME: emacs-pomodoro-package
  1894. #+BEGIN_SRC nix
  1895. epkgs.org-pomodoro
  1896. #+END_SRC
  1897. Org Pomodoro[fn:65] adds basic support for the Pomodoro Technique[fn:66] 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.
  1898. #+NAME: emacs-pomodoro-elisp
  1899. #+BEGIN_SRC emacs-lisp
  1900. ;; Configure `org-pomodor' with the overtime workflow.
  1901. (setq org-pomodoro-manual-break t
  1902. org-pomodoro-keep-killed-time t)
  1903. ;; Configure keybindings.
  1904. (dotfiles/leader
  1905. "op" '(org-pomodoro :which-key "Pomodoro"))
  1906. #+END_SRC
  1907. ** Writegood Mode
  1908. #+NAME: emacs-writegood-package
  1909. #+BEGIN_SRC nix
  1910. epkgs.writegood-mode
  1911. #+END_SRC
  1912. Writegood Mode[fn:67] is an Emacs[fn:2] minor mode to aid in finding common writing problems. It highlights the text based on the following criteria:
  1913. + Weasel Words
  1914. + Passive Voice
  1915. + Duplicate Words
  1916. #+NAME: emacs-writegood-elisp
  1917. #+BEGIN_SRC emacs-lisp
  1918. ;; Configure `writegood-mode'.
  1919. (dotfiles/leader
  1920. "tg" '(writegood-mode :which-key "Grammar"))
  1921. #+END_SRC
  1922. ** Aspell
  1923. #+NAME: emacs-aspell-extras
  1924. #+BEGIN_SRC nix
  1925. pkgs.aspell
  1926. pkgs.aspellDicts.en
  1927. pkgs.aspellDicts.en-science
  1928. pkgs.aspellDicts.en-computers
  1929. #+END_SRC
  1930. GNU Aspell[fn:68] 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.
  1931. #+NAME: emacs-aspell-elisp
  1932. #+BEGIN_SRC emacs-lisp
  1933. ;; Use `aspell' as a drop-in replacement for `ispell'.
  1934. (setq ispell-program-name "aspell"
  1935. ispell-eextra-args '("--sug-mode=fast"))
  1936. ;; Configure the built-in `flyspell-mode'.
  1937. (dotfiles/leader
  1938. "ts" '(flyspell-mode :which-key "Spelling"))
  1939. #+END_SRC
  1940. ** TexLive
  1941. TeX Live[fn:69] is a free software distributution for the TeX typesetting system that includes major TeX-related programs, macro packages, and fonts. Since TeX Live consists of /thousands/ of packages, to make managing it easier, NixOS replicates the organization of Tex Live into /schemes/ and /collections/[fn:70]:
  1942. | Name | Derivation | Comment |
  1943. |---------+---------------------------------+------------------------------------------------------------|
  1944. | Full | texlive.combined.scheme-full | Contains every TeX Live package |
  1945. | Medium | texlive.combined.scheme-medium | Contains everything in small + more packages and languages |
  1946. | Small | texlive.combined.scheme-small | Contains everything in basic + xetex + metapost |
  1947. | Basic | texlive.combined.scheme-basic | Contains everything in the plain scheme but includes latex |
  1948. | Minimal | texlive.combined.scheme-minimal | Contains plain only |
  1949. #+NAME: emacs-texlive-extras
  1950. #+BEGIN_SRC nix
  1951. pkgs.texlive.combined.scheme-full
  1952. #+END_SRC
  1953. ** Http
  1954. #+NAME: emacs-http-package
  1955. #+BEGIN_SRC nix
  1956. epkgs.ob-http
  1957. #+END_SRC
  1958. It's possible to make HTTP requests from Org Mode buffers using ob-http[fn:71], this relies on Org Babel being present and configured properly.
  1959. #+NAME: emacs-http-elisp
  1960. #+BEGIN_SRC emacs-lisp
  1961. ;; Required to setup `ob-http'.
  1962. (org-babel-do-load-languages
  1963. 'org-babel-load-languages
  1964. '((http . t)))
  1965. #+END_SRC
  1966. ** Hugo
  1967. #+NAME: emacs-hugo-package
  1968. #+BEGIN_SRC nix
  1969. epkgs.ox-hugo
  1970. #+END_SRC
  1971. Ox-Hugo[fn:72] is an Org-Mode[fn:60] exporter for Hugo[fn:33] compabile markdown. I post nonsense on my Personal Blog[fn:73], and share my notes on various textbooks, articles, and software Here[fn:74].
  1972. #+NAME: emacs-hugo-elisp
  1973. #+BEGIN_SRC emacs-lisp
  1974. ;; Configure `ox-hugo' as an `org-mode-export' backend.
  1975. (require 'ox-hugo)
  1976. ;; Set up the base directory.
  1977. (setq org-hugo-base-dir (expand-file-name "/etc/dotfiles/docs"))
  1978. ;; Capture templates.
  1979. ;; Shared content.
  1980. ;; (add-to-list 'org-roam-capture-templates
  1981. ;; '("p" "Post" plain "%?"
  1982. ;; :target (file+head "docs/posts/${slug}.org.gpg"
  1983. ;; "
  1984. ;; ,#+TITLE: ${title}
  1985. ;; ,#+AUTHOR: Christopher James Hayward
  1986. ;; ,#+DATE: %<%Y-%m-%d>
  1987. ;; ,#+EXPORT_FILE_NAME: ${slug}
  1988. ;; ,#+OPTIONS: num:nil todo:nil tasks:nil
  1989. ;; ,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
  1990. ;; ,#+HUGO_BASE_DIR: ../
  1991. ;; ,#+HUGO_AUTO_SET_LASTMOD: t
  1992. ;; ,#+HUGO_SECTION: posts
  1993. ;; ,#+HUGO_DRAFT: true
  1994. ;; "
  1995. ;; )
  1996. ;; :unnarrowed t))
  1997. #+END_SRC
  1998. ** Passwords
  1999. #+NAME: emacs-pass-extras
  2000. #+BEGIN_SRC nix
  2001. pkgs.pass
  2002. #+END_SRC
  2003. With Pass[fn:75], 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.
  2004. #+NAME: emacs-pass-package
  2005. #+BEGIN_SRC nix
  2006. epkgs.password-store
  2007. #+END_SRC
  2008. Configure keybindings for passwords behind =SPC p=:
  2009. #+NAME: emacs-pass-elisp
  2010. #+BEGIN_SRC emacs-lisp
  2011. ;; Set the path to the password store.
  2012. (setq password-store-dir (expand-file-name "~/.password-store"))
  2013. ;; Apply custom keybindings.
  2014. (dotfiles/leader
  2015. "p" '(:ignore t :which-key "Passwords")
  2016. "pp" '(password-store-copy :which-key "Copy")
  2017. "pe" '(password-store-edit :which-key "Edit")
  2018. "pi" '(password-store-insert :which-key "Insert")
  2019. "pr" '(password-store-rename :which-key "Rename")
  2020. "pg" '(password-store-generate :which-key "Generate"))
  2021. #+END_SRC
  2022. ** Docker
  2023. #+NAME: emacs-docker-package
  2024. #+BEGIN_SRC nix
  2025. epkgs.docker
  2026. epkgs.dockerfile-mode
  2027. #+END_SRC
  2028. Manage Docker from inside of Emacs using Docker.el[fn:76]. This is a full docker porcelain similar to Magit, allowing complete control of a Docker system. Add syntax highlighting to Dockerfiles using dockerfile-mode[fn:77] from Spotify.
  2029. #+NAME: emacs-docker-elisp
  2030. #+BEGIN_SRC emacs-lisp
  2031. ;; Apply custom keybindings.
  2032. (dotfiles/leader
  2033. "n" '(:ignore t :which-key "Containers")
  2034. "nd" '(docker :which-key "Docker"))
  2035. #+END_SRC
  2036. ** MU4E
  2037. #+NAME: emacs-mu4e-extras
  2038. #+BEGIN_SRC nix
  2039. pkgs.mu
  2040. pkgs.isync
  2041. #+END_SRC
  2042. #+NAME: emacs-mu4e-package
  2043. #+BEGIN_SRC nix
  2044. epkgs.mu4e-alert
  2045. #+END_SRC
  2046. #+NAME: emacs-mu4e-config
  2047. #+BEGIN_SRC nix
  2048. # Deploy the authinfo file.
  2049. home.file.".authinfo.gpg".source = ../config/authinfo.gpg;
  2050. # Deploy the isync configuration file.
  2051. home.file.".mbsyncrc" = {
  2052. text = ''
  2053. IMAPStore xyz-remote
  2054. Host mail.chrishayward.xyz
  2055. User chris@chrishayward.xyz
  2056. PassCmd "pass chrishayward.xyz/chris"
  2057. SSLType IMAPS
  2058. MaildirStore xyz-local
  2059. Path ~/.cache/mail/
  2060. Inbox ~/.cache/mail/inbox
  2061. SubFolders Verbatim
  2062. Channel xyz
  2063. Far :xyz-remote:
  2064. Near :xyz-local:
  2065. Patterns * !Archives
  2066. Create Both
  2067. Expunge Both
  2068. SyncState *
  2069. '';
  2070. };
  2071. #+END_SRC
  2072. #+BEGIN_SRC sh
  2073. mbsync -a
  2074. mu init --maildir="~/.cache/mail" --my-address="chris@chrishayward.xyz"
  2075. mu index
  2076. #+END_SRC
  2077. #+NAME: emacs-mu4e-elisp
  2078. #+BEGIN_SRC emacs-lisp
  2079. ;; Add the `mu4e' shipped with `mu' to the load path.
  2080. (add-to-list 'load-path "/etc/profiles/per-user/chris/share/emacs/site-lisp/mu4e/")
  2081. (require 'mu4e)
  2082. ;; Confiugure `mu4e'.
  2083. (setq mu4e-maildir "~/.cache/mail"
  2084. mu4e-update-interval (* 5 60)
  2085. mu4e-get-mail-command "mbsync -a"
  2086. mu4e-compose-format-flowed t
  2087. mu4e-change-filenames-when-moving t
  2088. mu4e-compose-signature (concat "Chris Hayward\n"
  2089. "chris@chrishayward.xyz"))
  2090. ;; Sign all outbound email with GPG.
  2091. (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
  2092. (setq message-send-mail-function 'smtpmail-send-it
  2093. mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
  2094. ;; Setup `mu4e' accounts.
  2095. (setq mu4e-contexts
  2096. (list
  2097. ;; Main
  2098. ;; chris@chrishayward.xyz
  2099. (make-mu4e-context
  2100. :name "Main"
  2101. :match-func
  2102. (lambda (msg)
  2103. (when msg
  2104. (string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
  2105. :vars
  2106. '((user-full-name . "Christopher James Hayward")
  2107. (user-mail-address . "chris@chrishayward.xyz")
  2108. (smtpmail-smtp-server . "mail.chrishayward.xyz")
  2109. (smtpmail-smtp-service . 587)
  2110. (smtpmail-stream-type . starttls)))))
  2111. ;; Setup `mu4e-alert'.
  2112. (setq mu4e-alert-set-default-style 'libnotify)
  2113. (mu4e-alert-enable-notifications)
  2114. (mu4e-alert-enable-mode-line-display)
  2115. ;; Open the `mu4e' dashboard.
  2116. (dotfiles/leader
  2117. "m" '(mu4e :which-key "Mail"))
  2118. #+END_SRC
  2119. ** Projectile
  2120. #+NAME: emacs-projectile-package
  2121. #+BEGIN_SRC nix
  2122. epkgs.projectile
  2123. #+END_SRC
  2124. Projectile[fn:78] 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.
  2125. #+NAME: emacs-projectile-elisp
  2126. #+BEGIN_SRC emacs-lisp
  2127. ;; Configure the `projectile-project-search-path'.
  2128. (setq projectile-project-search-path '("~/.local/source"))
  2129. (projectile-mode +1)
  2130. #+END_SRC
  2131. ** LSP Mode
  2132. #+NAME: emacs-lsp-package
  2133. #+BEGIN_SRC nix
  2134. epkgs.lsp-mode
  2135. epkgs.lsp-ui
  2136. #+END_SRC
  2137. The Language Server Protocol (LSP)[fn:79] defines the protocol used between an Editor or IDE, and a language server that provides features like:
  2138. + Auto Complete
  2139. + Go To Defintion
  2140. + Find All References
  2141. #+NAME: emacs-lsp-elisp
  2142. #+BEGIN_SRC emacs-lisp
  2143. ;; Configure `lsp-mode'.
  2144. (setq lsp-idle-delay 0.5
  2145. lsp-prefer-flymake t)
  2146. ;; Configure `lsp-ui'.
  2147. (setq lsp-ui-doc-position 'at-point
  2148. lsp-ui-doc-delay 0.5)
  2149. #+END_SRC
  2150. ** CCLS
  2151. #+NAME: emacs-ccls-package
  2152. #+BEGIN_SRC nix
  2153. epkgs.ccls
  2154. #+END_SRC
  2155. Emacs CCLS[fn:80] is a client for CCLS, a C/C++/Objective-C language server supporting multi-million line C++ code bases, powered by libclang.
  2156. #+NAME: emacs-ccls-elisp
  2157. #+BEGIN_SRC emacs-lisp
  2158. ;; Configure `ccls' to work with `lsp-mode'.
  2159. (defun dotfiles/ccls-hook ()
  2160. (require 'ccls)
  2161. (lsp))
  2162. ;; Configure `ccls' mode hooks.
  2163. (add-hook 'c-mode-hook 'dotfiles/ccls-hook)
  2164. (add-hook 'c++-mode-hook 'dotfiles/ccls-hook)
  2165. (add-hook 'objc-mode-hook 'dotfiles/ccls-hook)
  2166. (add-hook 'cuda-mode-hook 'dotfiles/ccls-hook)
  2167. #+END_SRC
  2168. ** Company Mode
  2169. #+NAME: emacs-company-package
  2170. #+BEGIN_SRC nix
  2171. epkgs.company
  2172. #+END_SRC
  2173. Company[fn:81] 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.
  2174. #+NAME: emacs-company-elisp
  2175. #+BEGIN_SRC emacs-lisp
  2176. ;; Configure `company-mode'.
  2177. (setq company-backend 'company-capf
  2178. lsp-completion-provider :capf)
  2179. ;; Enable it globally.
  2180. (global-company-mode +1)
  2181. #+END_SRC
  2182. ** Go Mode
  2183. #+NAME: emacs-golang-package
  2184. #+BEGIN_SRC nix
  2185. epkgs.go-mode
  2186. #+END_SRC
  2187. Go Mode[fn:82] is a major mode for editing Golang[fn:12] source code in GNU/Emacs[fn:2].
  2188. #+NAME: emacs-golang-elisp
  2189. #+BEGIN_SRC emacs-lisp
  2190. ;; Configure `go-mode' to work with `lsp-mode'.
  2191. (defun dotfiles/go-hook ()
  2192. (add-hook 'before-save-hook #'lsp-format-buffer t t)
  2193. (add-hook 'before-save-hook #'lsp-organize-imports t t))
  2194. ;; Configure a custom `before-save-hook'.
  2195. (add-hook 'go-mode-hook #'dotfiles/go-hook)
  2196. #+END_SRC
  2197. ** Rustic
  2198. #+NAME: emacs-rustic-package
  2199. #+BEGIN_SRC nix
  2200. epkgs.rustic
  2201. #+END_SRC
  2202. Rustic[fn:81] is a fork of rust-mode that integrates well with the Language Server Protocol[fn:75]. Include the rust shell before launching GNU/Emacs[fn:2] to use this!
  2203. #+NAME: emacs-rustic-elisp
  2204. #+BEGIN_SRC emacs-lisp
  2205. ;; Configure `rustic' with `lsp-mode'.
  2206. (setq rustic-format-on-save t
  2207. rustic-lsp-server 'rls)
  2208. #+END_SRC
  2209. ** Python Mode
  2210. #+NAME: emacs-python-package
  2211. #+BEGIN_SRC nix
  2212. epkgs.pretty-mode
  2213. #+END_SRC
  2214. The built in Python Mode[fn:83] has a nice feature set for working with Python[fn:19] code in GNU/Emacs[fn:2]. It is complimented with the addition of an LSP[fn:79] server. These tools are included in the Development Shell[fn:11] for Python[fn:19].
  2215. #+NAME: emacs-python-elisp
  2216. #+BEGIN_SRC emacs-lisp
  2217. ;; Configure `pretty-mode' to work with `python-mode'.
  2218. (add-hook 'python-mode-hook
  2219. (lambda ()
  2220. (turn-on-pretty-mode)))
  2221. #+END_SRC
  2222. ** Protobuf Mode
  2223. #+NAME: emacs-protobuf-package
  2224. #+BEGIN_SRC nix
  2225. epkgs.protobuf-mode
  2226. #+END_SRC
  2227. ** PlantUML
  2228. #+NAME: emacs-plantuml-extras
  2229. #+BEGIN_SRC nix
  2230. pkgs.plantuml
  2231. #+END_SRC
  2232. PlantUML[fn:84] is an open-source tool allowing users to create diagrams from a plain-text language. Besides various UML diagrams, PlantUML[fn:84] has support for various other software developmented related formats, as well as visualizations of =JSON= and =YAML= files.
  2233. #+NAME: emacs-plantuml-package
  2234. #+BEGIN_SRC nix
  2235. epkgs.plantuml-mode
  2236. #+END_SRC
  2237. PlantUML Mode[fn:85] is a major mode for editing PlantUML[fn:84] sources in GNU/Emacs[fn:2].
  2238. #+NAME: emacs-plantuml-elisp
  2239. #+BEGIN_SRC emacs-lisp
  2240. ;; Configure `plantuml-mode'.
  2241. (add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
  2242. (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t)))
  2243. (setq plantuml-default-exec-mode 'executable
  2244. org-plantuml-exec-mode 'plantuml)
  2245. #+END_SRC
  2246. ** Swiper
  2247. #+NAME: emacs-swiper-package
  2248. #+BEGIN_SRC nix
  2249. epkgs.ivy
  2250. epkgs.counsel
  2251. epkgs.ivy-rich
  2252. epkgs.ivy-posframe
  2253. epkgs.ivy-prescient
  2254. #+END_SRC
  2255. Ivy (Swiper)[fn:86] 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.
  2256. #+NAME: emacs-swiper-elisp
  2257. #+BEGIN_SRC emacs-lisp
  2258. ;; Configure `ivy'.
  2259. (setq counsel-linux-app-format-function
  2260. #'counsel-linux-app-format-function-name-only)
  2261. (ivy-mode +1)
  2262. (counsel-mode +1)
  2263. ;; Configure `ivy-rich'.
  2264. (ivy-rich-mode +1)
  2265. ;; Configure `ivy-posframe'.
  2266. (setq ivy-posframe-parameters '((parent-frame nil))
  2267. ivy-posframe-display-functions-alist '((t . ivy-posframe-display)))
  2268. (ivy-posframe-mode +1)
  2269. ;; Configure `ivy-prescient'.
  2270. (setq ivy-prescient-enable-filtering nil)
  2271. (ivy-prescient-mode +1)
  2272. #+END_SRC
  2273. ** Transparency
  2274. 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.
  2275. #+NAME: emacs-transparency-elisp
  2276. #+BEGIN_SRC emacs-lisp
  2277. ;; Configure the default frame transparency.
  2278. (set-frame-parameter (selected-frame) 'alpha '(95 . 95))
  2279. (add-to-list 'default-frame-alist '(alpha . (95 . 95)))
  2280. #+END_SRC
  2281. ** Desktop Environment
  2282. #+NAME: emacs-desktop-extras
  2283. #+BEGIN_SRC nix
  2284. pkgs.brightnessctl
  2285. #+END_SRC
  2286. The Desktop Environment[fn:87] package provides commands and a global minor mode for controlling your GNU/Linux[fn:1] desktop from within GNU/Emacs[fn:2].
  2287. #+NAME: emacs-desktop-package
  2288. #+BEGIN_SRC nix
  2289. epkgs.desktop-environment
  2290. #+END_SRC
  2291. 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.
  2292. #+NAME: emacs-desktop-elisp
  2293. #+BEGIN_SRC emacs-lisp
  2294. ;; Configure `desktop-environment'.
  2295. (require 'desktop-environment)
  2296. (desktop-environment-mode +1)
  2297. #+END_SRC
  2298. ** Doom Themes
  2299. #+NAME: emacs-doom-themes-package
  2300. #+BEGIN_SRC nix
  2301. epkgs.doom-themes
  2302. #+END_SRC
  2303. Doom Themes[fn:88] is a theme megapack for GNU/Emacs[fn:2], inspired by community favourites.
  2304. #+NAME: emacs-doom-themes-elisp
  2305. #+BEGIN_SRC emacs-lisp
  2306. ;; Include modern themes from `doom-themes'.
  2307. (setq doom-themes-enable-bold t
  2308. doom-themes-enable-italic t)
  2309. ;; Load the `doom-nord' and `doom-nord-light' themes.
  2310. ;; (load-theme 'doom-nord-light t)
  2311. (load-theme 'doom-nord t)
  2312. (doom-modeline-mode +1)
  2313. ;; Load a new theme with <SPC> t t.
  2314. (dotfiles/leader
  2315. "tt" '(counsel-load-theme :which-key "Theme"))
  2316. #+END_SRC
  2317. ** Doom Modeline
  2318. #+NAME: emacs-doom-modeline-package
  2319. #+BEGIN_SRC nix
  2320. epkgs.doom-modeline
  2321. #+END_SRC
  2322. Doom Modeline[fn:26] is a fancy and fast modeline inspired by minimalism design. It's integrated into Centaur Emacs, Doom Emacs, and Spacemacs.
  2323. #+NAME: emacs-doom-modeline-elisp
  2324. #+BEGIN_SRC emacs-lisp
  2325. ;; Add the `doom-modeline' after initialization.
  2326. (add-hook 'after-init-hook 'doom-modeline-mode)
  2327. (setq doom-modeline-height 16
  2328. doom-modeline-icon t)
  2329. #+END_SRC
  2330. * Footnotes
  2331. [fn:1] https://gnu.org
  2332. [fn:2] https://gnu.org/software/emacs/
  2333. [fn:3] https://literateprogramming.com/knuthweb.pdf
  2334. [fn:4] https://nixos.org/manual/nixos/stable
  2335. [fn:5] https://nixos.org/manual/nix/stable
  2336. [fn:6] https://nixos.org/manual/nixpkgs/stable
  2337. [fn:7] https://github.com/nix-community/home-manager
  2338. [fn:8] https://github.com/nix-community/emacs-overlay
  2339. [fn:9] https://github.com/nixos/nixos-hardware
  2340. [fn:10] https://github.com/t184256/nix-on-droid
  2341. [fn:11] https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html
  2342. [fn:12] https://golang.org
  2343. [fn:13] https://rust-lang.org
  2344. [fn:14] https://nodejs.org
  2345. [fn:15] https://openjdk.java.net
  2346. [fn:16] https://grpc.io
  2347. [fn:17] https://iso.org/standard/74528.html
  2348. [fn:18] https://en.wikipedia.org/wiki/C++/
  2349. [fn:19] https://python.org
  2350. [fn:20] https://docs.docker.com/compose/
  2351. [fn:21] https://docker.org
  2352. [fn:22] https://docs.docker.com/machine/
  2353. [fn:23] https://heroku.com
  2354. [fn:24] https://qemu.org
  2355. [fn:25] https://github.com/ch11ng/exwm
  2356. [fn:26] https://laptopmedia.com/laptop-specs/acer-nitro-5-an515-53-2
  2357. [fn:27] https://raspberrypi.org/products/raspberry-pi-400/
  2358. [fn:28] https://www.raspberrypi.org/products/raspberry-pi-4-model-b/
  2359. [fn:29] https://samsung.com/us/mobile/galaxy-s10/buy/
  2360. [fn:30] https://x.org/wiki/
  2361. [fn:31] https://wayland.freedesktop.org
  2362. [fn:32] https://openssh.com
  2363. [fn:33] https://gohugo.io
  2364. [fn:34] https://nixos.wiki/wiki/Flakes
  2365. [fn:35] https://nix-community.cachix.org
  2366. [fn:36] https://nixos.wiki/wiki/Nvidia
  2367. [fn:37] https://en.wikipedia.org/wiki/Firefox
  2368. [fn:38] https://jellyfin.org
  2369. [fn:39] https://moonlight-stream.org
  2370. [fn:40] https://teamviewer.com
  2371. [fn:41] https://git-scm.com
  2372. [fn:42] https://emacswiki.org/emacs/LearnEmacsLisp
  2373. [fn:43] https://neovim.io
  2374. [fn:44] https://gtk.org
  2375. [fn:45] https://github.com/nixos/nix-mode
  2376. [fn:46] https://evil.readthedocs.io/en/latest/overview.html
  2377. [fn:47] https://github.com/noctuid/general.el
  2378. [fn:48] https://github.com/justbur/emacs-which-key
  2379. [fn:49] https://emacswiki.org/emacs/eww
  2380. [fn:50] https://gnu.org/software/emacs/erc.html
  2381. [fn:51] https://emacswiki.org/emacs/DiredMode
  2382. [fn:52] https://emacswiki.org/emacs/DiredExtra#Dired_X
  2383. [fn:53] https://github.com/domtronn/all-the-icons.el
  2384. [fn:54] https://github.com/iqbalansari/emacs-emojify
  2385. [fn:55] https://gnu.org/software/emacs/manual/html_mono/eshell.html
  2386. [fn:56] https://github.com/akermu/emacs-libvterm
  2387. [fn:57] https://github.com/neovim/libvterm
  2388. [fn:58] https://magit.vc
  2389. [fn:59] https://github.com/skeeto/elfeed
  2390. [fn:60] https://orgmode.org
  2391. [fn:61] https://github.com/org-roam/org-roam
  2392. [fn:62] https://zettelkasten.de
  2393. [fn:63] DEFINITION NOT FOUND.
  2394. [fn:64] https://orgmode.org/worg/org-contrib/org-drill.html
  2395. [fn:65] https://github.com/marcinkoziej/org-pomodoro
  2396. [fn:66] https://en.wikipedia.org/wiki/Pomodoro_Technique
  2397. [fn:67] https://github.com/bnbeckwith/writegood-mode
  2398. [fn:68] https://aspell.net
  2399. [fn:69] https://wikipedia.org/wiki/Tex_Live
  2400. [fn:70] https://nixos.wiki/wiki/TexLive
  2401. [fn:71] https://github.com/zweifisch/ob-http
  2402. [fn:72] https://oxhugo.scripter.co
  2403. [fn:73] https://chrishayward.xyz/posts/
  2404. [fn:74] https://chrishayward.xyz/notes/
  2405. [fn:75] https://password-store.org
  2406. [fn:76] https://github.com/Silex/docker.el
  2407. [fn:77] https://github.com/spotify/dockerfile-mode
  2408. [fn:78] https://projectile.mx
  2409. [fn:79] https://microsoft.github.io/language-server-protocol
  2410. [fn:80] https://github.com/MaskRay/emacs-ccls
  2411. [fn:81] https://company-mode.github.io
  2412. [fn:82] https://emacswiki.org/emacs/GoMode
  2413. [fn:83] https://plantuml.com
  2414. [fn:84] https://github.com/skuro/plantuml-mode
  2415. [fn:85] https://github.com/abo-abo/swiper
  2416. [fn:86] https://github.com/DamienCassou/desktop-environment
  2417. [fn:87] https://github.com/hlissner/emacs-doom-themes
  2418. [fn:88] https://github.com/seagle0128/doom-modeline
  2419. [fn:89] https://revealjs.com
  2420. [fn:90] https://github.com/hexmode/ox-reveal