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.

3135 lines
91 KiB

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