From b4b0b44729c5ac193c514c51534bc8a16198d7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Schwarz=C3=A4ugl?= Date: Sun, 29 Dec 2024 20:11:53 +0100 Subject: [PATCH] chore: generate emacs headlines, index update --- SwarselSystems.org | 81 ++ index.html | 2559 +++++++++++++++----------------------------- 2 files changed, 929 insertions(+), 1711 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 8e96c99..8fbb51a 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -542,6 +542,9 @@ Nix on Android also demands an own flake output, which is provided here. #+end_src ** topologyConfigurations +:PROPERTIES: +:CUSTOM_ID: h:1337e267-bca3-4c65-863f-9f44b753dee4 +:END: #+begin_src nix :tangle no :noweb-ref topologyconf @@ -573,10 +576,16 @@ This section mainly exists house different `default.nix` files to define some mo Every host is housed in the =hosts/= directory, which is then subdivided by each respective system (=nixos/=, =home-manager/=, =nix-on-droid/=, =darwin/=). As described earlier, some of these configurations (nixos and darwin) can be defined automatically in this flake. For home-manager and nix-on-droid, the system architecture must be defined manually. *** Template +:PROPERTIES: +:CUSTOM_ID: h:373bd9e8-616e-434e-bfab-c216ce4470e9 +:END: This is the template that I use for new deployments of personal machines. Servers are usually highly tailored to their specific task and I do not consider it worth a time to craft a template for that. Also, at least at the current time, I only provide a template for NixOS hosts, as I rarely ever use anything else. **** Main Configuration +:PROPERTIES: +:CUSTOM_ID: h:859aec97-65a2-4633-b7d8-73d4ccf89cc5 +:END: #+begin_src nix :tangle templates/hosts/nixos/default.nix { self, inputs, outputs, config, pkgs, lib, ... }: @@ -659,6 +668,9 @@ This is the template that I use for new deployments of personal machines. Server } #+end_src **** disko +:PROPERTIES: +:CUSTOM_ID: h:24757d1e-6e88-4843-ab20-5e0c1b7ae29e +:END: Acceptance of arbitraty argumments is here needed because =disko= passes =diskoFile= to this file. @@ -801,6 +813,9 @@ This is a list of all physical machines that I maintain. My work machine. Built for more security, this is the gold standard of my configurations at the moment. ***** Main Configuration +:PROPERTIES: +:CUSTOM_ID: h:567c0055-f5f7-4e53-8f13-d767d7166e9d +:END: #+begin_src nix :tangle hosts/nixos/nbl-imba-2/default.nix { self, inputs, outputs, config, pkgs, lib, ... }: let @@ -1026,6 +1041,9 @@ My work machine. Built for more security, this is the gold standard of my config #+end_src ***** hardware-configuration +:PROPERTIES: +:CUSTOM_ID: h:25115a54-c634-4896-9a41-254064ce9fcc +:END: #+begin_src nix :tangle hosts/nixos/nbl-imba-2/hardware-configuration.nix { config, lib, modulesPath, ... }: @@ -1070,6 +1088,9 @@ My work machine. Built for more security, this is the gold standard of my config #+end_src ***** disko +:PROPERTIES: +:CUSTOM_ID: h:e0da04c7-4199-44b0-b525-6cfc64072b45 +:END: #+begin_src nix :tangle hosts/nixos/nbl-imba-2/disk-config.nix { @@ -1159,6 +1180,9 @@ My work machine. Built for more security, this is the gold standard of my config This is my main server that I run at home. It handles most tasks that require bigger amounts of storage than I can receive for free at OCI. Also it houses some data that I find too sensitive to hand over to Oracle. ***** Main Configuration +:PROPERTIES: +:CUSTOM_ID: h:8ad68406-4a75-45ba-97ad-4c310b921124 +:END: #+begin_src nix :tangle hosts/nixos/winters/default.nix { self, inputs, outputs, config, ... }: let @@ -1235,6 +1259,9 @@ This is my main server that I run at home. It handles most tasks that require bi #+end_src ***** hardware-configuration +:PROPERTIES: +:CUSTOM_ID: h:0fdefb4f-ce53-4caf-89ed-5d79646f70f0 +:END: #+begin_src nix :tangle hosts/nixos/winters/hardware-configuration.nix { config, lib, modulesPath, ... }: @@ -1494,11 +1521,20 @@ This machine mainly acts as an external sync helper. It manages the following th #+end_src *** Utility hosts +:PROPERTIES: +:CUSTOM_ID: h:89ce533d-4856-4988-b456-0951d4453db8 +:END: **** Toto (Physical/VM) +:PROPERTIES: +:CUSTOM_ID: h:6b495f0e-fc11-44c8-a9e8-83f3d95c8857 +:END: This is a slim setup for developing base configuration. I do not track the hardware-configuration for this host here because I often switch this configuration between running on a QEMU VM and a physical laptop and do not want to constantly adapt the config here to reflect the current state. ***** Main Configuration +:PROPERTIES: +:CUSTOM_ID: h:4e53b40b-98b2-4615-b1b0-3696a75edd6e +:END: #+begin_src nix :tangle hosts/nixos/toto/default.nix { self, inputs, outputs, config, pkgs, lib, ... }: let @@ -1600,6 +1636,9 @@ This is a slim setup for developing base configuration. I do not track the hardw #+end_src ***** disko +:PROPERTIES: +:CUSTOM_ID: h:cec82b06-39ca-4c0e-b4f5-c1fda9b14e6d +:END: #+begin_src nix :tangle hosts/nixos/toto/disk-config.nix # NOTE: ... is needed because dikso passes diskoFile @@ -1922,6 +1961,9 @@ This is the "reference implementation" of a setup that runs without NixOS, only #+end_src **** ChaosTheatre (Demo Physical/VM) +:PROPERTIES: +:CUSTOM_ID: h:e1498bef-ec67-483d-bf02-76264e30be8e +:END: This is just a demo host. It applies all the configuration found in the common parts of the flake, but disables all secrets-related features (as they would not work without the proper SSH keys). @@ -3000,6 +3042,9 @@ This program sets up a new NixOS host remotely. It also takes care of secret man #+end_src **** swarsel-rebuild +:PROPERTIES: +:CUSTOM_ID: h:1eabdc59-8832-44ca-a22b-11f848ab150a +:END: This program builds a configuration locally. @@ -3105,6 +3150,9 @@ This program builds a configuration locally. #+end_src **** swarsel-install +:PROPERTIES: +:CUSTOM_ID: h:fbd8aaf2-9dca-4ca3-aca1-19d0d188a435 +:END: This program sets up a new NixOS host locally. @@ -3286,6 +3334,9 @@ This program sets up a new NixOS host locally. #+end_src **** swarsel-postinstall +:PROPERTIES: +:CUSTOM_ID: h:c98a7615-e5da-4f47-8ed1-2b2ea65519e9 +:END: This program sets up a new NixOS host locally. @@ -3418,6 +3469,9 @@ This script allows for quick git branch switching. #+end_src **** vershell +:PROPERTIES: +:CUSTOM_ID: h:7806b129-a4a5-4d10-af27-6cbeafbcb294 +:END: This script allows for quick git branch switching. @@ -3435,6 +3489,9 @@ This script allows for quick git branch switching. #+end_src **** eontimer +:PROPERTIES: +:CUSTOM_ID: h:9fda7829-09a4-4b8f-86f6-08b078ab2874 +:END: This script allows for quick git branch switching. @@ -3689,6 +3746,9 @@ I usually use =mutableUsers = false= in my NixOS configuration. However, on a ne #+end_src ***** Server +:PROPERTIES: +:CUSTOM_ID: h:d10f8aaf-2f71-4e80-ba05-37bfc98c99b6 +:END: #+begin_src nix :tangle modules/nixos/server.nix { lib, ... }: @@ -4234,6 +4294,9 @@ Set in firefox =about:config > toolkit.legacyUserProfileCustomizations.styleshee #+end_src *** Library functions +:PROPERTIES: +:CUSTOM_ID: h:4d38c9f7-2680-4c02-a1f4-ed8db0d55ce4 +:END: This section defines all functions of my own that I add to =lib=. These are used in all places over the config, with many of them being used in =flake.nix=. @@ -5956,6 +6019,9 @@ Since I hide the waybar completely during normal operation, I run the risk of no #+end_src **** Lanzaboote +:PROPERTIES: +:CUSTOM_ID: h:d9a89071-b3ba-44d1-b5e0-e9ca6270d377 +:END: This dynamically uses systemd boot or Lanzaboote depending on `config.swarselsystems.initialSetup` and `config.swarselsystems.isSecureBoot`. @@ -12168,6 +12234,9 @@ This minor-mode adds functionality for doing better surround-commands; for examp #+end_src **** evil-visual-mark-mode +:PROPERTIES: +:CUSTOM_ID: h:df6729b6-2135-4070-bcab-a6a26f0fb2c4 +:END: #+begin_src emacs-lisp @@ -14101,6 +14170,9 @@ This sets up the =dashboard=, which is really quite useless. But, it looks cool #+end_src *** Less logging +:PROPERTIES: +:CUSTOM_ID: h:438d928f-77a8-477a-ac8b-ca54ec673f91 +:END: #+begin_src emacs-lisp @@ -14175,6 +14247,9 @@ This is where the theme for the whole OS is defined. Originally, this noweb-ref }; #+end_src * Appendix B: Supplementary Files +:PROPERTIES: +:CUSTOM_ID: h:8fc9f66a-7412-4091-8dee-a06f897baf67 +:END: This section now holds some of the configuration files that cannot be defined directly within NixOS configuration. These files are usually symlinked using =home.file=. @@ -14653,6 +14728,9 @@ This is the stylesheet used by waybar. #+end_src ** justfile +:PROPERTIES: +:CUSTOM_ID: h:788937cf-8816-466b-8e57-1b695cb50f52 +:END: This file defines a few workflows that I often need to run when working on my configuration. This works similar to =make=, but is geared towards general tasks and as such requires no extra handling (as long as there are no dependencies involved) or =.PHONY= recipes. (In the org-src block I still call it a Makefile in order to get syntax highlighting) @@ -14689,6 +14767,9 @@ This file defines a few workflows that I often need to run when working on my co #+end_src ** statix.toml +:PROPERTIES: +:CUSTOM_ID: h:d4dcb884-f24f-4786-8fa6-9f36c88a706e +:END: This file is used to tell =statix= which checks and folders/fiels to ignore, as well as to specify the nix version that it should use. diff --git a/index.html b/index.html index 2e8ab76..f60b0e5 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -213,32 +213,32 @@
  • 2.7. darwinConfigurations
  • 2.8. homeConfigurations
  • 2.9. nixOnDroidConfigurations
  • -
  • 2.10. topologyConfigurations
  • +
  • 2.10. topologyConfigurations
  • 3. System
  • 3.2.2. Overlays (additions, overrides, nixpkgs-stable)
  • @@ -303,7 +303,7 @@
  • 3.2.3.1.1. Wallpaper
  • 3.2.3.1.2. Hardware
  • 3.2.3.1.3. Setup
  • -
  • 3.2.3.1.4. Server
  • +
  • 3.2.3.1.4. Server
  • 3.2.3.1.5. Input
  • @@ -324,7 +324,7 @@ -
  • 3.2.4. Library functions
  • +
  • 3.2.4. Library functions
  • 3.3. NixOS @@ -381,7 +381,7 @@
  • 3.3.1.29. Podmam (distrobox)
  • 3.3.1.30. Handle lid switch correctly
  • 3.3.1.31. Low battery notification
  • -
  • 3.3.1.32. Lanzaboote
  • +
  • 3.3.1.32. Lanzaboote
  • 3.3.2. Server @@ -448,7 +448,7 @@
  • 3.4.1.5. SSH Machines
  • 3.4.1.6. Theme (stylix)
  • 3.4.1.7. Desktop Entries, MIME types (xdg)
  • -
  • 3.4.1.8. Linking dotfiles
  • +
  • 3.4.1.8. Linking dotfiles (Symlinks home.file)
  • 3.4.1.9. Sourcing environment variables
  • 3.4.1.10. General Programs: bottom, imv, sioyek, bat, carapace, wlogout, swayr, yt-dlp, mpv, jq, nix-index, ripgrep, pandoc, fzf
  • 3.4.1.11. nix-index
  • @@ -526,10 +526,9 @@
  • 4.2.1.11. org-mode: Upon-save actions (Auto-tangle, export to html, formatting)
  • 4.2.1.12. org-mode: Fold current heading
  • 4.2.1.13. corfu: Do not interrupt navigation
  • -
  • 4.2.1.14. python shell reloading
  • -
  • 4.2.1.15. Nix common prefix bracketer
  • -
  • 4.2.1.16. Nix formatters
  • -
  • 4.2.1.17. Disable garbace collection while minibuffer is active
  • +
  • 4.2.1.14. Nix common prefix bracketer
  • +
  • 4.2.1.15. Nix formatters
  • +
  • 4.2.1.16. Disable garbace collection while minibuffer is active
  • 4.2.2. Custom Keybindings
  • @@ -553,6 +552,7 @@
  • 4.3.7.3. evil-snipe
  • 4.3.7.4. evil-cleverparens
  • 4.3.7.5. evil-surround
  • +
  • 4.3.7.6. evil-visual-mark-mode
  • 4.3.8. ispell
  • @@ -590,23 +590,20 @@
  • 4.4.1. Org Mode
  • 4.4.2. Nix Mode
  • @@ -622,72 +619,46 @@
  • 4.4.9.2. LaTeX in Markdown
  • -
  • 4.4.10. Olivetti
  • -
  • 4.4.11. elfeed
  • -
  • 4.4.12. darkroom
  • -
  • 4.4.13. Ripgrep
  • -
  • 4.4.14. Tree-sitter
  • -
  • 4.4.15. direnv (envrc)
  • -
  • 4.4.16. avy
  • -
  • 4.4.17. crdt (Collaborative Editing)
  • -
  • 4.4.18. devdocs
  • -
  • 4.4.19. Projectile
  • -
  • 4.4.20. Magit
  • -
  • 4.4.21. Yubikey support
  • -
  • 4.4.22. Forge
  • -
  • 4.4.23. git-timemachine
  • -
  • 4.4.24. Delimiters (brackets): rainbow-delimiters, highlight-parentheses
  • -
  • 4.4.25. rainbow-mode
  • -
  • 4.4.26. Corfu
  • -
  • 4.4.27. cape
  • -
  • 4.4.28. rust
  • -
  • 4.4.29. Tramp
  • -
  • 4.4.30. diff-hl
  • -
  • 4.4.31. Commenting
  • -
  • 4.4.32. yasnippet +
  • 4.4.10. elfeed
  • +
  • 4.4.11. Ripgrep
  • +
  • 4.4.12. Tree-sitter
  • +
  • 4.4.13. direnv (envrc)
  • +
  • 4.4.14. avy
  • +
  • 4.4.15. devdocs
  • +
  • 4.4.16. Projectile
  • +
  • 4.4.17. Magit
  • +
  • 4.4.18. Yubikey support
  • +
  • 4.4.19. Forge
  • +
  • 4.4.20. git-timemachine
  • +
  • 4.4.21. Delimiters (brackets): rainbow-delimiters, highlight-parentheses
  • +
  • 4.4.22. rainbow-mode
  • +
  • 4.4.23. Corfu
  • +
  • 4.4.24. cape
  • +
  • 4.4.25. rust
  • +
  • 4.4.26. Tramp
  • +
  • 4.4.27. diff-hl
  • +
  • 4.4.28. Commenting
  • +
  • 4.4.29. eglot
  • +
  • 4.4.30. sideline-flymake
  • +
  • 4.4.31. Prevent breaking of hardlinks
  • +
  • 4.4.32. Dirvish
  • +
  • 4.4.33. undo-tree
  • +
  • 4.4.34. Hydra -
  • -
  • 4.4.33. eglot
  • -
  • 4.4.34. sideline-flymake
  • -
  • 4.4.35. Breadcrumb
  • -
  • 4.4.36. Prevent breaking of hardlinks
  • -
  • 4.4.37. Dirvish
  • -
  • 4.4.38. pdf-tools: pdf-viewer and support for dirvish
  • -
  • 4.4.39. Jupyter
  • -
  • 4.4.40. undo-tree
  • -
  • 4.4.41. Hydra +
  • 4.4.35. Email
  • -
  • 4.4.42. External Applications - -
  • -
  • 4.4.43. Email - -
  • -
  • 4.4.44. Calendar
  • -
  • 4.4.45. Dashboard: emacs startup screen
  • -
  • 4.4.46. vterm
  • -
  • 4.4.47. multiple cursors
  • +
  • 4.4.36. Calendar
  • +
  • 4.4.37. Dashboard: emacs startup screen
  • +
  • 4.4.38. vterm
  • +
  • 4.4.39. multiple cursors
  • +
  • 4.4.40. Less logging
  • @@ -697,20 +668,20 @@
  • 5.1. Theme (stylix)
  • -
  • 6. Appendix B: Supplementary Files +
  • 6. Appendix B: Supplementary Files
  • -This file has 60522 words spanning 15453 lines and was last revised on 2024-12-29 02:23:09 +0100. +This file has 57175 words spanning 14786 lines and was last revised on 2024-12-29 20:11:24 +0100.

    @@ -763,7 +734,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry

    -My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-12-29 02:23:09 +0100) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-12-29 20:11:24 +0100)

    @@ -824,8 +795,8 @@ Lastly, I add this javascript bit to the file in order to have a darkmode toggle "<script>\n" "function addDarkmodeWidget() {\n" "new Darkmode().showWidget();\n" -"}\n" -"window.addEventListener('load', addDarkmodeWidget);\n" + "}\n" + "window.addEventListener('load', addDarkmodeWidget);\n" "</script>") @@ -874,8 +845,7 @@ In outputs = inputs@ [...], the inputs@ makes it so th

    -
    -{
    +
    {
       description = "SwarseFlake - Nix Flake for all SwarselSystems";
     
       nixConfig = {
    @@ -883,124 +853,82 @@ In outputs = inputs@ [...], the inputs@ makes it so th
           "https://nix-community.cachix.org"
           "https://cache.ngi0.nixos.org/"
         ];
    -
         extra-trusted-public-keys = [
           "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
           "cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="
         ];
       };
    -
       inputs = {
     
         nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    -
         nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
    -
         systems.url = "github:nix-systems/default-linux";
    -
    -    # user-level configuration
         home-manager = {
           url = "github:nix-community/home-manager";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
    -    # overlay to access bleeding edge emacs
         emacs-overlay = {
           url = "github:nix-community/emacs-overlay";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
    -    # nix user repository
    -    # i use this mainly to not have to build all firefox extensions
    -    # myself as well as for the emacs-init package (tbd)
         nur.url = "github:nix-community/NUR";
    -
    -    # provides GL to non-NixOS hosts
         nixgl.url = "github:guibou/nixGL";
    -
    -    # manages all theming using Home-Manager
         stylix.url = "github:danth/stylix";
    -
    -    # nix secrets management
         sops-nix.url = "github:Mic92/sops-nix";
    -
    -    # enable secure boot on NixOS
         lanzaboote.url = "github:nix-community/lanzaboote";
    -
    -    # nix for android
         nix-on-droid = {
           url = "github:nix-community/nix-on-droid/release-24.05";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
    -    # generate NixOS images
         nixos-generators = {
           url = "github:nix-community/nixos-generators";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
    -    # hardware quirks on nix
         nixos-hardware = {
           url = "github:NixOS/nixos-hardware/master";
         };
    -
    -    # dynamic library loading
         nix-alien = {
           url = "github:thiagokokada/nix-alien";
         };
    -
    -    # automatic nintendo switch payload injection
         nswitch-rcm-nix = {
           url = "github:Swarsel/nswitch-rcm-nix";
         };
    -
    -    # weekly updated nix-index database
         nix-index-database = {
           url = "github:nix-community/nix-index-database";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
         disko = {
    -       url =  "github:nix-community/disko";
    -       inputs.nixpkgs.follows = "nixpkgs";
    +      url =  "github:nix-community/disko";
    +      inputs.nixpkgs.follows = "nixpkgs";
         };
    -
         impermanence.url = "github:nix-community/impermanence";
    -
         zjstatus = {
           url = "github:dj95/zjstatus";
         };
    -
         fw-fanctrl = {
           url = "github:TamtamHero/fw-fanctrl/packaging/nix";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
         nix-darwin = {
           url = "github:lnl7/nix-darwin";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
         pre-commit-hooks = {
           url = "github:cachix/git-hooks.nix";
           inputs.nixpkgs.follows = "nixpkgs";
         };
    -
         nix-secrets = {
           url = "git+ssh://git@github.com/Swarsel/nix-secrets.git?ref=main&shallow=1";
           flake = false;
           inputs = { };
         };
    -
         nix-topology.url = "github:oddlama/nix-topology";
     
       };
    -
       outputs =
         inputs@{ self
         , nixpkgs
         , home-manager
    -    , nix-darwin
         , systems
         , ...
         }:
    @@ -1055,94 +983,83 @@ In outputs = inputs@ [...], the inputs@ makes it so th
               ];
               appSet = lib.swarselsystems.mkApps system appNames self;
             in
    -        {
    -          inherit appSet;
    -          default = appSet.bootstrap;
    -        });
    +          {
    +            inherit appSet;
    +            default = appSet.bootstrap;
    +          });
     
           devShells = lib.swarselsystems.forAllSystems (system:
             let
    -          pkgs = nixpkgs.legacyPackages.${system};
    +          pkgs = lib.swarselsystems.pkgsFor.${system};
               checks = self.checks.${system};
             in
    -        {
    -          default = pkgs.mkShell {
    -            NIX_CONFIG = "experimental-features = nix-command flakes";
    -            inherit (checks.pre-commit-check) shellHook;
    -            buildInputs = checks.pre-commit-check.enabledPackages;
    -            nativeBuildInputs = with pkgs; [
    -              nix
    -              home-manager
    -              git
    -              just
    -              age
    -              ssh-to-age
    -              sops
    -              statix
    -              deadnix
    -              nixpkgs-fmt
    -            ];
    -          };
    -        }
    +          {
    +            default = pkgs.mkShell {
    +              NIX_CONFIG = "experimental-features = nix-command flakes";
    +              inherit (checks.pre-commit-check) shellHook;
    +              buildInputs = checks.pre-commit-check.enabledPackages;
    +              nativeBuildInputs = [
    +                pkgs.nix
    +                pkgs.home-manager
    +                pkgs.git
    +                pkgs.just
    +                pkgs.age
    +                pkgs.ssh-to-age
    +                pkgs.sops
    +                pkgs.statix
    +                pkgs.deadnix
    +                pkgs.nixpkgs-fmt
    +              ];
    +            };
    +          }
           );
     
           checks = lib.swarselsystems.forAllSystems (system:
             let
               pkgs = nixpkgs.legacyPackages.${system};
             in
    -        import ./checks { inherit self inputs system pkgs; }
    +          import ./checks { inherit self inputs system pkgs; }
           );
     
    -
           nixosConfigurations =
    -        lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "nixos") "nixos";
    -
    +      lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "nixos") "nixos";
           homeConfigurations =
     
    -        # "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration {
    -        #  pkgs = lib.swarselsystems.pkgsFor.x86_64-linux;
    -        #  extraSpecialArgs = { inherit inputs outputs; };
    -        #   modules = homeModules ++ mixedModules ++ [
    -        #     ./hosts/home-manager
    -        #   ];
    -        # };
    -
    -        lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "home") "home" lib.swarselsystems.pkgsFor.x86_64-linux;
    -
    +      # "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration {
    +      #  pkgs = lib.swarselsystems.pkgsFor.x86_64-linux;
    +      #  extraSpecialArgs = { inherit inputs outputs; };
    +      #   modules = homeModules ++ mixedModules ++ [
    +      #     ./hosts/home-manager
    +      #   ];
    +      # };
     
    +      lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "home") "home" lib.swarselsystems.pkgsFor.x86_64-linux;
           darwinConfigurations =
    -        lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "darwin") "darwin";
    -
    +      lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "darwin") "darwin";
           nixOnDroidConfigurations =
     
    -        # magicant = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
    -        #  pkgs = lib.swarselsystems.pkgsFor.aarch64-linux;
    -        #   modules = [
    -        #     ./hosts/magicant
    -        #   ];
    -        # };
    -
    -        lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "android") "android" lib.swarselsystems.pkgsFor.aarch64-linux;
    -
    +      # magicant = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
    +      #  pkgs = lib.swarselsystems.pkgsFor.aarch64-linux;
    +      #   modules = [
    +      #     ./hosts/magicant
    +      #   ];
    +      # };
     
    +      lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "android") "android" lib.swarselsystems.pkgsFor.aarch64-linux;
     
           topology =
     
    -        lib.swarselsystems.forEachSystem (pkgs: import inputs.nix-topology {
    -          inherit pkgs;
    -          modules = [
    -            # Your own file to define global topology. Works in principle like a nixos module but uses different options.
    -            # ./topology.nix
    -            { inherit (self) nixosConfigurations; }
    -          ];
    -        });
    +      lib.swarselsystems.forEachSystem (pkgs: import inputs.nix-topology {
    +        inherit pkgs;
    +        modules = [
    +          # Your own file to define global topology. Works in principle like a nixos module but uses different options.
    +          # ./topology.nix
    +          { inherit (self) nixosConfigurations; }
    +        ];
    +      });
     
    -
    -    };
    +      };
     }
    -
    -
    -
     
    @@ -1272,105 +1189,67 @@ This automatically creates a topology diagram of my configuration.
     nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    -
     nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
    -
     systems.url = "github:nix-systems/default-linux";
    -
    -# user-level configuration
     home-manager = {
       url = "github:nix-community/home-manager";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
    -# overlay to access bleeding edge emacs
     emacs-overlay = {
       url = "github:nix-community/emacs-overlay";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
    -# nix user repository
    -# i use this mainly to not have to build all firefox extensions
    -# myself as well as for the emacs-init package (tbd)
     nur.url = "github:nix-community/NUR";
    -
    -# provides GL to non-NixOS hosts
     nixgl.url = "github:guibou/nixGL";
    -
    -# manages all theming using Home-Manager
     stylix.url = "github:danth/stylix";
    -
    -# nix secrets management
     sops-nix.url = "github:Mic92/sops-nix";
    -
    -# enable secure boot on NixOS
     lanzaboote.url = "github:nix-community/lanzaboote";
    -
    -# nix for android
     nix-on-droid = {
       url = "github:nix-community/nix-on-droid/release-24.05";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
    -# generate NixOS images
     nixos-generators = {
       url = "github:nix-community/nixos-generators";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
    -# hardware quirks on nix
     nixos-hardware = {
       url = "github:NixOS/nixos-hardware/master";
     };
    -
    -# dynamic library loading
     nix-alien = {
       url = "github:thiagokokada/nix-alien";
     };
    -
    -# automatic nintendo switch payload injection
     nswitch-rcm-nix = {
       url = "github:Swarsel/nswitch-rcm-nix";
     };
    -
    -# weekly updated nix-index database
     nix-index-database = {
       url = "github:nix-community/nix-index-database";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
     disko = {
    -   url =  "github:nix-community/disko";
    -   inputs.nixpkgs.follows = "nixpkgs";
    +  url =  "github:nix-community/disko";
    +  inputs.nixpkgs.follows = "nixpkgs";
     };
    -
     impermanence.url = "github:nix-community/impermanence";
    -
     zjstatus = {
       url = "github:dj95/zjstatus";
     };
    -
     fw-fanctrl = {
       url = "github:TamtamHero/fw-fanctrl/packaging/nix";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
     nix-darwin = {
       url = "github:lnl7/nix-darwin";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
     pre-commit-hooks = {
       url = "github:cachix/git-hooks.nix";
       inputs.nixpkgs.follows = "nixpkgs";
     };
    -
     nix-secrets = {
       url = "git+ssh://git@github.com/Swarsel/nix-secrets.git?ref=main&shallow=1";
       flake = false;
       inputs = { };
     };
    -
     nix-topology.url = "github:oddlama/nix-topology";
     
     
    @@ -1481,42 +1360,42 @@ apps = lib.swarselsystems.forAllSystems (system: ]; appSet = lib.swarselsystems.mkApps system appNames self; in - { - inherit appSet; - default = appSet.bootstrap; - }); + { + inherit appSet; + default = appSet.bootstrap; + }); devShells = lib.swarselsystems.forAllSystems (system: let - pkgs = nixpkgs.legacyPackages.${system}; + pkgs = lib.swarselsystems.pkgsFor.${system}; checks = self.checks.${system}; in - { - default = pkgs.mkShell { - NIX_CONFIG = "experimental-features = nix-command flakes"; - inherit (checks.pre-commit-check) shellHook; - buildInputs = checks.pre-commit-check.enabledPackages; - nativeBuildInputs = with pkgs; [ - nix - home-manager - git - just - age - ssh-to-age - sops - statix - deadnix - nixpkgs-fmt - ]; - }; - } + { + default = pkgs.mkShell { + NIX_CONFIG = "experimental-features = nix-command flakes"; + inherit (checks.pre-commit-check) shellHook; + buildInputs = checks.pre-commit-check.enabledPackages; + nativeBuildInputs = [ + pkgs.nix + pkgs.home-manager + pkgs.git + pkgs.just + pkgs.age + pkgs.ssh-to-age + pkgs.sops + pkgs.statix + pkgs.deadnix + pkgs.nixpkgs-fmt + ]; + }; + } ); checks = lib.swarselsystems.forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; in - import ./checks { inherit self inputs system pkgs; } + import ./checks { inherit self inputs system pkgs; } ); @@ -1604,9 +1483,9 @@ lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "android") "a
    -
    -

    2.10. topologyConfigurations

    -
    +
    +

    2.10. topologyConfigurations

    +
     lib.swarselsystems.forEachSystem (pkgs: import inputs.nix-topology {
    @@ -1638,16 +1517,16 @@ This section mainly exists house different `default.nix` files to define some mo
     Every host is housed in the hosts/ directory, which is then subdivided by each respective system (nixos/, home-manager/, nix-on-droid/, darwin/). As described earlier, some of these configurations (nixos and darwin) can be defined automatically in this flake. For home-manager and nix-on-droid, the system architecture must be defined manually.
     

    -
    -

    3.1.1. Template

    -
    +
    +

    3.1.1. Template

    +

    This is the template that I use for new deployments of personal machines. Servers are usually highly tailored to their specific task and I do not consider it worth a time to craft a template for that. Also, at least at the current time, I only provide a template for NixOS hosts, as I rarely ever use anything else.

    -
    -
    3.1.1.1. Main Configuration
    -
    +
    +
    3.1.1.1. Main Configuration
    +
    { self, inputs, outputs, config, pkgs, lib, ... }:
     let
    @@ -1731,9 +1610,9 @@ in
     
    -
    -
    3.1.1.2. disko
    -
    +
    +
    3.1.1.2. disko
    +

    Acceptance of arbitraty argumments is here needed because disko passes diskoFile to this file.

    @@ -1880,9 +1759,9 @@ This is a list of all physical machines that I maintain. My work machine. Built for more security, this is the gold standard of my configurations at the moment.

    -
    -
    3.1.2.1.1. Main Configuration
    -
    +
    +
    3.1.2.1.1. Main Configuration
    +
    { self, inputs, outputs, config, pkgs, lib, ... }:
     let
    @@ -1909,7 +1788,7 @@ in
     
         inputs.home-manager.nixosModules.home-manager
         {
    -      home-manager.users.swarsel.imports =  outputs.mixedModules ++ [
    +      home-manager.users.swarsel.imports = outputs.mixedModules ++ [
             "${profilesPath}/optional/home/gaming.nix"
             "${profilesPath}/optional/home/work.nix"
           ] ++ (builtins.attrValues outputs.homeManagerModules);
    @@ -1935,15 +1814,15 @@ in
         resumeDevice = "/dev/disk/by-label/nixos";
       };
     
    -   hardware = {
    -     amdgpu = {
    -       opencl.enable = true;
    -       amdvlk = {
    -         enable = true;
    -         support32Bit.enable = true;
    -       };
    -     };
    -   };
    +  hardware = {
    +    amdgpu = {
    +      opencl.enable = true;
    +      amdvlk = {
    +        enable = true;
    +        support32Bit.enable = true;
    +      };
    +    };
    +  };
     
       programs.fw-fanctrl.enable = true;
     
    @@ -1961,143 +1840,147 @@ in
         '';
       };
     
    -  swarselsystems = lib.recursiveUpdate {
    -    wallpaper = self + /wallpaper/lenovowp.png;
    -    hasBluetooth = true;
    -    hasFingerprint = true;
    -    isImpermanence = false;
    -    isSecureBoot = true;
    -    isCrypted = true;
    -  } sharedOptions;
    +  swarselsystems = lib.recursiveUpdate
    +    {
    +      wallpaper = self + /wallpaper/lenovowp.png;
    +      hasBluetooth = true;
    +      hasFingerprint = true;
    +      isImpermanence = false;
    +      isSecureBoot = true;
    +      isCrypted = true;
    +    }
    +    sharedOptions;
     
    -  home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate {
    -    isLaptop = true;
    -    isNixos = true;
    -    flakePath = "/home/swarsel/.dotfiles";
    -    cpuCount = 16;
    -    # temperatureHwmon = {
    -    #   isAbsolutePath = true;
    -    #   path = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
    -    #   input-filename = "temp1_input";
    -    # };
    -    #  ------   -----
    -    # | DP-4 | |eDP-1|
    -    #  ------   -----
    -    startup = [
    -      { command = "nextcloud --background"; }
    -      { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
    -      { command = "element-desktop --hidden  --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
    -      { command = "ANKI_WAYLAND=1 anki"; }
    -      { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
    -      { command = "nm-applet"; }
    -      { command = "teams-for-linux"; }
    -      { command = "1password"; }
    -      { command = "feishin"; }
    -    ];
    -    sharescreen = "eDP-2";
    -    lowResolution = "1280x800";
    -    highResolution = "2560x1600";
    -    monitors = {
    -      main = {
    -        name = "BOE 0x0BC9 Unknown";
    -        mode = "2560x1600"; # TEMPLATE
    -        scale = "1";
    -        position = "2560,0";
    -        workspace = "15:L";
    -        output = "eDP-2";
    +  home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate
    +    {
    +      isLaptop = true;
    +      isNixos = true;
    +      flakePath = "/home/swarsel/.dotfiles";
    +      cpuCount = 16;
    +      # temperatureHwmon = {
    +      #   isAbsolutePath = true;
    +      #   path = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
    +      #   input-filename = "temp1_input";
    +      # };
    +      #  ------   -----
    +      # | DP-4 | |eDP-1|
    +      #  ------   -----
    +      startup = [
    +        { command = "nextcloud --background"; }
    +        { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
    +        { command = "element-desktop --hidden  --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
    +        { command = "ANKI_WAYLAND=1 anki"; }
    +        { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
    +        { command = "nm-applet"; }
    +        { command = "teams-for-linux"; }
    +        { command = "1password"; }
    +        { command = "feishin"; }
    +      ];
    +      sharescreen = "eDP-2";
    +      lowResolution = "1280x800";
    +      highResolution = "2560x1600";
    +      monitors = {
    +        main = {
    +          name = "BOE 0x0BC9 Unknown";
    +          mode = "2560x1600"; # TEMPLATE
    +          scale = "1";
    +          position = "2560,0";
    +          workspace = "15:L";
    +          output = "eDP-2";
    +        };
    +        homedesktop = {
    +          name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
    +          mode = "2560x1440";
    +          scale = "1";
    +          position = "0,0";
    +          workspace = "1:一";
    +          output = "DP-11";
    +        };
    +        work_back_middle = {
    +          name = "LG Electronics LG Ultra HD 0x000305A6";
    +          mode = "2560x1440";
    +          scale = "1";
    +          position = "5120,0";
    +          workspace = "1:一";
    +          output = "DP-10";
    +        };
    +        work_front_left = {
    +          name = "LG Electronics LG Ultra HD 0x0007AB45";
    +          mode = "3840x2160";
    +          scale = "1";
    +          position = "5120,0";
    +          workspace = "1:一";
    +          output = "DP-7";
    +        };
    +        work_back_right = {
    +          name = "HP Inc. HP Z32 CN41212T55";
    +          mode = "3840x2160";
    +          scale = "1";
    +          position = "5120,0";
    +          workspace = "1:一";
    +          output = "DP-3";
    +        };
    +        work_middle_middle_main = {
    +          name = "HP Inc. HP 732pk CNC4080YL5";
    +          mode = "3840x2160";
    +          scale = "1";
    +          position = "-1280,0";
    +          workspace = "11:M";
    +          output = "DP-8";
    +        };
    +        work_middle_middle_side = {
    +          name = "Hewlett Packard HP Z24i CN44250RDT";
    +          mode = "1920x1200";
    +          transform = "270";
    +          scale = "1";
    +          position = "-2480,0";
    +          workspace = "12:S";
    +          output = "DP-9";
    +        };
    +        work_seminary = {
    +          name = "Applied Creative Technology Transmitter QUATTRO201811";
    +          mode = "1280x720";
    +          scale = "1";
    +          position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
    +          workspace = "12:S";
    +          output = "DP-4";
    +        };
           };
    -      homedesktop = {
    -        name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
    -        mode = "2560x1440";
    -        scale = "1";
    -        position = "0,0";
    -        workspace = "1:一";
    -        output = "DP-11";
    +      inputs = {
    +        "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = {
    +          xkb_layout = "us";
    +          xkb_variant = "altgr-intl";
    +        };
    +        "1133:45081:MX_Master_2S_Keyboard" = {
    +          xkb_layout = "us";
    +          xkb_variant = "altgr-intl";
    +        };
    +        "2362:628:PIXA3854:00_093A:0274_Touchpad" = {
    +          dwt = "enabled";
    +          tap = "enabled";
    +          natural_scroll = "enabled";
    +          middle_emulation = "enabled";
    +        };
    +        "1133:50504:Logitech_USB_Receiver" = {
    +          xkb_layout = "us";
    +          xkb_variant = "altgr-intl";
    +        };
    +        "1133:45944:MX_KEYS_S" = {
    +          xkb_layout = "us";
    +          xkb_variant = "altgr-intl";
    +        };
           };
    -      work_back_middle = {
    -        name = "LG Electronics LG Ultra HD 0x000305A6";
    -        mode = "2560x1440";
    -        scale = "1";
    -        position = "5120,0";
    -        workspace = "1:一";
    -        output = "DP-10";
    +      keybindings = {
    +        "Mod4+Ctrl+Shift+p" = "exec screenshare";
           };
    -      work_front_left = {
    -        name = "LG Electronics LG Ultra HD 0x0007AB45";
    -        mode = "3840x2160";
    -        scale = "1";
    -        position = "5120,0";
    -        workspace = "1:一";
    -        output = "DP-7";
    +      shellAliases = {
    +        ans2-15_3-9 = ". ~/.venvs/ansible39_2_15_0/bin/activate";
    +        ans3-9 = ". ~/.venvs/ansible39/bin/activate";
    +        ans = ". ~/.venvs/ansible/bin/activate";
    +        ans2-15 = ". ~/.venvs/ansible2.15.0/bin/activate";
           };
    -      work_back_right = {
    -        name = "HP Inc. HP Z32 CN41212T55";
    -        mode = "3840x2160";
    -        scale = "1";
    -        position = "5120,0";
    -        workspace = "1:一";
    -        output = "DP-3";
    -      };
    -      work_middle_middle_main = {
    -        name = "HP Inc. HP 732pk CNC4080YL5";
    -        mode = "3840x2160";
    -        scale = "1";
    -        position = "-1280,0";
    -        workspace = "11:M";
    -        output = "DP-8";
    -      };
    -      work_middle_middle_side = {
    -        name = "Hewlett Packard HP Z24i CN44250RDT";
    -        mode = "1920x1200";
    -        transform = "270";
    -        scale = "1";
    -        position = "-2480,0";
    -        workspace = "12:S";
    -        output = "DP-9";
    -      };
    -      work_seminary = {
    -        name = "Applied Creative Technology Transmitter QUATTRO201811";
    -        mode = "1280x720";
    -        scale = "1";
    -        position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
    -        workspace = "12:S";
    -        output = "DP-4";
    -      };
    -    };
    -    inputs = {
    -      "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = {
    -        xkb_layout = "us";
    -        xkb_variant = "altgr-intl";
    -      };
    -      "1133:45081:MX_Master_2S_Keyboard" = {
    -        xkb_layout = "us";
    -        xkb_variant = "altgr-intl";
    -      };
    -      "2362:628:PIXA3854:00_093A:0274_Touchpad" = {
    -        dwt = "enabled";
    -        tap = "enabled";
    -        natural_scroll = "enabled";
    -        middle_emulation = "enabled";
    -      };
    -      "1133:50504:Logitech_USB_Receiver" = {
    -        xkb_layout = "us";
    -        xkb_variant = "altgr-intl";
    -      };
    -      "1133:45944:MX_KEYS_S" = {
    -        xkb_layout = "us";
    -        xkb_variant = "altgr-intl";
    -      };
    -    };
    -    keybindings = {
    -      "Mod4+Ctrl+Shift+p" = "exec screenshare";
    -    };
    -    shellAliases = {
    -      ans2-15_3-9 = ". ~/.venvs/ansible39_2_15_0/bin/activate";
    -      ans3-9 = ". ~/.venvs/ansible39/bin/activate";
    -      ans = ". ~/.venvs/ansible/bin/activate";
    -      ans2-15 = ". ~/.venvs/ansible2.15.0/bin/activate";
    -    };
    -  } sharedOptions;
    +    }
    +    sharedOptions;
     }
     
     
    @@ -2105,9 +1988,9 @@ in
     
    -
    -
    3.1.2.1.2. hardware-configuration
    -
    +
    +
    3.1.2.1.2. hardware-configuration
    +
    { config, lib, modulesPath, ... }:
     {
    @@ -2153,9 +2036,9 @@ in
     
    -
    -
    3.1.2.1.3. disko
    -
    +
    +
    3.1.2.1.3. disko
    +
    {
       disko.devices = {
    @@ -2247,9 +2130,9 @@ in
     This is my main server that I run at home. It handles most tasks that require bigger amounts of storage than I can receive for free at OCI. Also it houses some data that I find too sensitive to hand over to Oracle.
     

    -
    -
    3.1.2.2.1. Main Configuration
    -
    +
    +
    3.1.2.2.1. Main Configuration
    +
    { self, inputs, outputs, config, ... }:
     let
    @@ -2268,7 +2151,7 @@ in
         inputs.home-manager.nixosModules.home-manager
         {
           home-manager.users.swarsel.imports = [
    -    "${profilesPath}/server/home"
    +        "${profilesPath}/server/home"
           ] ++ (builtins.attrValues outputs.homeManagerModules);
         }
     
    @@ -2327,9 +2210,9 @@ in
     
    -
    -
    3.1.2.2.2. hardware-configuration
    -
    +
    +
    3.1.2.2.2. hardware-configuration
    +
    { config, lib, modulesPath, ... }:
     
    @@ -2609,20 +2492,20 @@ in
     
    -
    -

    3.1.4. Utility hosts

    -
    +
    +

    3.1.4. Utility hosts

    +
    -
    -
    3.1.4.1. Toto (Physical/VM)
    -
    +
    +
    3.1.4.1. Toto (Physical/VM)
    +

    This is a slim setup for developing base configuration. I do not track the hardware-configuration for this host here because I often switch this configuration between running on a QEMU VM and a physical laptop and do not want to constantly adapt the config here to reflect the current state.

    -
    -
    3.1.4.1.1. Main Configuration
    -
    +
    +
    3.1.4.1.1. Main Configuration
    +
    { self, inputs, outputs, config, pkgs, lib, ... }:
     let
    @@ -2633,7 +2516,7 @@ let
     in
     {
     
    -  imports =  [
    +  imports = [
         inputs.disko.nixosModules.disko
         "${self}/hosts/nixos/toto/disk-config.nix"
         ./hardware-configuration.nix
    @@ -2654,7 +2537,7 @@ in
     
         inputs.home-manager.nixosModules.home-manager
         {
    -      home-manager.users.swarsel.imports =  [
    +      home-manager.users.swarsel.imports = [
             inputs.sops-nix.homeManagerModules.sops
             "${profilesPath}/common/home/settings.nix"
             "${profilesPath}/common/home/sops.nix"
    @@ -2697,22 +2580,26 @@ in
         firewall.enable = false;
       };
     
    -  swarselsystems = lib.recursiveUpdate {
    -    wallpaper = self + /wallpaper/lenovowp.png;
    -    isImpermanence = true;
    -    isCrypted = true;
    -    isSecureBoot = false;
    -    isSwap = true;
    -    swapSize = "8G";
    -    # rootDisk = "/dev/nvme0n1";
    -    rootDisk = "/dev/vda";
    -  } sharedOptions;
    +  swarselsystems = lib.recursiveUpdate
    +    {
    +      wallpaper = self + /wallpaper/lenovowp.png;
    +      isImpermanence = true;
    +      isCrypted = true;
    +      isSecureBoot = false;
    +      isSwap = true;
    +      swapSize = "8G";
    +      # rootDisk = "/dev/nvme0n1";
    +      rootDisk = "/dev/vda";
    +    }
    +    sharedOptions;
     
    -  home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate {
    -    isLaptop = false;
    -    isNixos = true;
    -    flakePath = "/home/swarsel/.dotfiles";
    -  } sharedOptions;
    +  home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate
    +    {
    +      isLaptop = false;
    +      isNixos = true;
    +      flakePath = "/home/swarsel/.dotfiles";
    +    }
    +    sharedOptions;
     
     }
     
    @@ -2721,9 +2608,9 @@ in
     
    -
    -
    3.1.4.1.2. disko
    -
    +
    +
    3.1.4.1.2. disko
    +
    # NOTE: ... is needed because dikso passes diskoFile
     { lib
    @@ -2873,10 +2760,10 @@ For added convenience, the live environment displays a helpful text on login, we
     
     
    ~SwarselSystems~
    -IP of primary interface: \4
    -The Password for all users & root is 'setup'.
    -Install the system remotely by running 'bootstrap -n <CONFIGURATION_NAME> -d <IP_FROM_ABOVE> ' on a machine with deployed secrets.
    -Alternatively, run 'swarsel-install -n <CONFIGURATION_NAME>' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
    +                         IP of primary interface: \4
    +                                                             The Password for all users & root is 'setup'.
    +                                                             Install the system remotely by running 'bootstrap -n <CONFIGURATION_NAME> -d <IP_FROM_ABOVE> ' on a machine with deployed secrets.
    +                                                             Alternatively, run 'swarsel-install -n <CONFIGURATION_NAME>' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
     
     
    @@ -3013,14 +2900,14 @@ in
    -
    3.1.4.3. Home-manager only (non-NixOS)
    +
    3.1.4.3. Home-manager only (default non-NixOS)

    This is the "reference implementation" of a setup that runs without NixOS, only relying on home-manager. I try to test this every now and then and keep it supported. However, manual steps are needed to get the system to work fully, depending on what distribution you are running on.

    -
    { self, inputs, outputs, config, ... }:
    +
    { self, outputs, config, ... }:
     {
     
       imports = outputs.homeModules ++ outputs.mixedModules ++ (builtins.attrValues outputs.homeManagerModules);
    @@ -3058,9 +2945,9 @@ This is the "reference implementation" of a setup that runs without NixOS, only
     
    -
    -
    3.1.4.4. ChaosTheatre (Demo Physical/VM)
    -
    +
    +
    3.1.4.4. ChaosTheatre (Demo Physical/VM)
    +

    This is just a demo host. It applies all the configuration found in the common parts of the flake, but disables all secrets-related features (as they would not work without the proper SSH keys).

    @@ -3202,8 +3089,8 @@ let "vershell" "eontimer" ]; - in - lib.swarselsystems.mkPackages packageNames pkgs +in +lib.swarselsystems.mkPackages packageNames pkgs @@ -3922,14 +3809,14 @@ function update_sops_file() { SOPS_FILE=".sops.yaml" sed -i "{ - # Remove any * and & entries for this host - /[*&]$key_name/ d; - # Inject a new age: entry - # n matches the first line following age: and p prints it, then we transform it while reusing the spacing - /age:/{n; p; s/\(.*- \*\).*/\1$key_name/}; - # Inject a new hosts or user: entry - /&$key_type/{n; p; s/\(.*- &\).*/\1$key_name $key/} - }" $SOPS_FILE + # Remove any * and & entries for this host + /[*&]$key_name/ d; + # Inject a new age: entry + # n matches the first line following age: and p prints it, then we transform it while reusing the spacing + /age:/{n; p; s/\(.*- \*\).*/\1$key_name/}; + # Inject a new hosts or user: entry + /&$key_type/{n; p; s/\(.*- &\).*/\1$key_name $key/} + }" $SOPS_FILE green "Updating .sops.yaml" cd - } @@ -4196,9 +4083,9 @@ writeShellApplication {
    -
    -
    3.2.1.18. swarsel-rebuild
    -
    +
    +
    3.2.1.18. swarsel-rebuild
    +

    This program builds a configuration locally.

    @@ -4307,9 +4194,9 @@ writeShellApplication {
    -
    -
    3.2.1.19. swarsel-install
    -
    +
    +
    3.2.1.19. swarsel-install
    +

    This program sets up a new NixOS host locally.

    @@ -4494,9 +4381,9 @@ writeShellApplication {
    -
    -
    3.2.1.20. swarsel-postinstall
    -
    +
    +
    3.2.1.20. swarsel-postinstall
    +

    This program sets up a new NixOS host locally.

    @@ -4576,7 +4463,6 @@ green "Disabling initialSetup" sed -i '/swarselsystems\.initialSetup = true;/d' /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/hardware-configuration.nix sudo nixos-rebuild --flake .#"$target_config" switch green "Post-install finished!" -
    @@ -4637,9 +4523,9 @@ writeShellApplication {
    -
    -
    3.2.1.23. vershell
    -
    +
    +
    3.2.1.23. vershell
    +

    This script allows for quick git branch switching.

    @@ -4659,9 +4545,9 @@ writeShellApplication {
    -
    -
    3.2.1.24. eontimer
    -
    +
    +
    3.2.1.24. eontimer
    +

    This script allows for quick git branch switching.

    @@ -4753,15 +4639,15 @@ let }; retroarch = prev.retroarch.withCores (cores: with cores; [ - snes9x # snes - nestopia # nes - dosbox # dos - scummvm # scumm - vba-m # gb/a - mgba # gb/a - melonds # ds - dolphin # gc/wii - ]); + snes9x # snes + nestopia # nes + dosbox # dos + scummvm # scumm + vba-m # gb/a + mgba # gb/a + melonds # ds + dolphin # gc/wii + ]); # #river = prev.river.overrideAttrs (oldAttrs: rec { # pname = "river"; @@ -4931,9 +4817,9 @@ I usually use mutableUsers = false in my NixOS configuration. Howev
    -
    -
    3.2.3.1.4. Server
    -
    +
    +
    3.2.3.1.4. Server
    +
    { lib, ... }:
     {
    @@ -5358,16 +5244,16 @@ Set in firefox about:config > toolkit.legacyUserProfileCustomizations.s
     
     
    { self, lib, pkgs, ... }:
    -  let
    -    lock-false = {
    -      Value = false;
    -      Status = "locked";
    -    };
    -    lock-true = {
    -      Value = true;
    -      Status = "locked";
    -    };
    -  in
    +let
    +  lock-false = {
    +    Value = false;
    +    Status = "locked";
    +  };
    +  lock-true = {
    +    Value = true;
    +    Status = "locked";
    +  };
    +in
     {
       options.swarselsystems.firefox = lib.mkOption {
         type = lib.types.attrs;
    @@ -5516,9 +5402,9 @@ Set in firefox about:config > toolkit.legacyUserProfileCustomizations.s
     
    -
    -

    3.2.4. Library functions

    -
    +
    +

    3.2.4. Library functions

    +

    This section defines all functions of my own that I add to lib. These are used in all places over the config, with many of them being used in flake.nix.

    @@ -5579,7 +5465,7 @@ A breakdown of each function: mkFullHostConfigs = hosts: type: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkFullHost host type) hosts); - mkHalfHostConfigs = hosts: type: pkgs: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkFullHost host type pkgs) hosts); + mkHalfHostConfigs = hosts: type: pkgs: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkHalfHost host type pkgs) hosts); readHosts = type: lib.attrNames (builtins.readDir "${self}/hosts/${type}"); @@ -6494,15 +6380,15 @@ in WIREGUARDPUB=${config.sops.placeholder.wireguardpub} WIREGUARDENDPOINT=${config.sops.placeholder.wireguardendpoint} ''; - ".authinfo" = { - owner = "swarsel"; - path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo"; - content = '' - machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass} - machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass} - machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass} - ''; - }; + # ".authinfo" = { + # owner = "swarsel"; + # path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo"; + # content = '' + # machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass} + # machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass} + # machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass} + # ''; + # }; }; }; } @@ -6522,7 +6408,6 @@ By default, stylix wants to style
    { self, pkgs, home-manager, config, ... }:
     {
       stylix = {
    -
         enable = true;
         base16Scheme = "${self}/wallpaper/swarsel.yaml";
         # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
    @@ -6546,7 +6431,6 @@ By default, stylix wants to style
             # name = "FiraCode Nerd Font Propo";
             # name = "Montserrat";
           };
    -
           sansSerif = {
             # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
             package = pkgs.cantarell-fonts;
    @@ -6555,19 +6439,15 @@ By default, stylix wants to style
             # name = "FiraCode Nerd Font Propo";
             # name = "Montserrat";
           };
    -
           monospace = {
             package = pkgs.nerd-fonts.fira-mono; # has overrides
    -
             name = "FiraCode Nerd Font Mono";
           };
    -
           emoji = {
             package = pkgs.noto-fonts-emoji;
             name = "Noto Color Emoji";
           };
         };
    -
         targets.grub.enable = false; # the styling makes grub more ugly
         image = config.swarselsystems.wallpaper;
       };
    @@ -6727,7 +6607,6 @@ This allows me to use my big scanner/printer's scanning function over the networ
         enable = true;
         extraBackends = [ pkgs.sane-airscan ];
       };
    -
     
    @@ -6756,7 +6635,6 @@ services.printing = { BrowseProtocols all ''; }; -
    @@ -6769,8 +6647,7 @@ Avahi is the service used for the network discovery.

    -
    -services.avahi = {
    +
    services.avahi = {
       enable = true;
       nssmdns4 = true;
       openFirewall = true;
    @@ -7162,10 +7039,10 @@ in
           ];
     
         files = [
    -        "/etc/ssh/ssh_host_ed25519_key"
    -        "/etc/ssh/ssh_host_ed25519_key.pub"
    -        "/etc/ssh/ssh_host_rsa_key"
    -        "/etc/ssh/ssh_host_rsa_key.pub"
    +      "/etc/ssh/ssh_host_ed25519_key"
    +      "/etc/ssh/ssh_host_ed25519_key.pub"
    +      "/etc/ssh/ssh_host_rsa_key"
    +      "/etc/ssh/ssh_host_rsa_key.pub"
         ];
       };
     
    @@ -7398,9 +7275,9 @@ Since I hide the waybar completely during normal operation, I run the risk of no
     
    -
    -
    3.3.1.32. Lanzaboote
    -
    +
    +
    3.3.1.32. Lanzaboote
    +

    This dynamically uses systemd boot or Lanzaboote depending on `config.swarselsystems.initialSetup` and `config.swarselsystems.isSecureBoot`.

    @@ -7450,39 +7327,39 @@ let in { imports = [ - "${profilesPath}/common/nixos/settings.nix" - "${profilesPath}/common/nixos/home-manager.nix" - "${profilesPath}/common/nixos/xserver.nix" - "${profilesPath}/common/nixos/gc.nix" - "${profilesPath}/common/nixos/store.nix" - "${profilesPath}/common/nixos/time.nix" - "${profilesPath}/common/nixos/users.nix" - "${profilesPath}/common/nixos/nix-ld.nix" - ./settings.nix - ./packages.nix - ./sops.nix - ./ssh.nix - ./nfs.nix - ./nginx.nix - ./kavita.nix - ./jellyfin.nix - ./navidrome.nix - ./spotifyd.nix - ./mpd.nix - ./matrix.nix - ./pipewire.nix - ./nextcloud.nix - ./immich.nix - ./paperless.nix - ./transmission.nix - ./syncthing.nix - ./restic.nix - ./monitoring.nix - ./jenkins.nix - ./emacs.nix - ./forgejo.nix - ./ankisync.nix - ./freshrss.nix + "${profilesPath}/common/nixos/settings.nix" + "${profilesPath}/common/nixos/home-manager.nix" + "${profilesPath}/common/nixos/xserver.nix" + "${profilesPath}/common/nixos/gc.nix" + "${profilesPath}/common/nixos/store.nix" + "${profilesPath}/common/nixos/time.nix" + "${profilesPath}/common/nixos/users.nix" + "${profilesPath}/common/nixos/nix-ld.nix" + ./settings.nix + ./packages.nix + ./sops.nix + ./ssh.nix + ./nfs.nix + ./nginx.nix + ./kavita.nix + ./jellyfin.nix + ./navidrome.nix + ./spotifyd.nix + ./mpd.nix + ./matrix.nix + ./pipewire.nix + ./nextcloud.nix + ./immich.nix + ./paperless.nix + ./transmission.nix + ./syncthing.nix + ./restic.nix + ./monitoring.nix + ./jenkins.nix + ./emacs.nix + ./forgejo.nix + ./ankisync.nix + ./freshrss.nix ]; } @@ -8668,7 +8545,7 @@ in isSystemUser = true; }; - users.groups.syncthing = {}; + users.groups.syncthing = { }; services.syncthing = { enable = true; @@ -9060,7 +8937,7 @@ It serves both a Greader API at
    _:
     {
    -  imports =  [
    +  imports = [
         ./settings.nix
         ./packages.nix
         ./custom-packages.nix
    @@ -10086,7 +9965,6 @@ This section has been notably empty ever since switching to stylix. Only Emacs i
     
    { self, lib, config, pkgs, ... }:
     {
       stylix = lib.mkIf (!config.swarselsystems.isNixos) {
    -
         enable = true;
         base16Scheme = "${self}/wallpaper/swarsel.yaml";
         # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
    @@ -10110,7 +9988,6 @@ This section has been notably empty ever since switching to stylix. Only Emacs i
             # name = "FiraCode Nerd Font Propo";
             # name = "Montserrat";
           };
    -
           sansSerif = {
             # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
             package = pkgs.cantarell-fonts;
    @@ -10119,19 +9996,15 @@ This section has been notably empty ever since switching to stylix. Only Emacs i
             # name = "FiraCode Nerd Font Propo";
             # name = "Montserrat";
           };
    -
           monospace = {
             package = pkgs.nerd-fonts.fira-mono; # has overrides
    -
             name = "FiraCode Nerd Font Mono";
           };
    -
           emoji = {
             package = pkgs.noto-fonts-emoji;
             name = "Noto Color Emoji";
           };
         };
    -
         image = config.swarselsystems.wallpaper;
         targets = {
           emacs.enable = false;
    @@ -10245,7 +10118,7 @@ _:
     
    -
    3.4.1.8. Linking dotfiles
    +
    3.4.1.8. Linking dotfiles (Symlinks home.file)

    This section should be used in order to symlink already existing configuration files using `home.file` and setting session variables using `home.sessionVariables`. @@ -10291,10 +10164,10 @@ Also in firefox `about:config > toolkit.legacyUserProfileCustomizations.style

    -
      xdg.configFile = {
    -    "tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc;
    -    "tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css;
    -  };
    +
    xdg.configFile = {
    +  "tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc;
    +  "tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css;
    +};
     }
     
    @@ -10780,34 +10653,6 @@ Here we set some aliases (some of them should be shellApplications instead) as w zle -N my-backward-delete-whole-word # bind this new widget to `ctrl+alt+w` bindkey '^W' my-backward-delete-whole-word - - vterm_printf() { - if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ]); then - # Tell tmux to pass the escape sequences through - printf "\ePtmux;\e\e]%s\007\e\\" "$1" - elif [ "''${TERM%%-*}" = "screen" ]; then - # GNU screen (screen, screen-256color, screen-256color-bce) - printf "\eP\e]%s\007\e\\" "$1" - else - printf "\e]%s\e\\" "$1" - fi - } - vterm_prompt_end() { - vterm_printf "51;A$(whoami)@$(hostname):$(pwd)" - } - setopt PROMPT_SUBST - PROMPT=$PROMPT'%{$(vterm_prompt_end)%}' - - vterm_cmd() { - local vterm_elisp - vterm_elisp="" - while [ $# -gt 0 ]; do - vterm_elisp="$vterm_elisp""$(printf '"%s" ' "$(printf "%s" "$1" | sed -e 's|\\|\\\\|g' -e 's|"|\\"|g')")" - shift - done - vterm_printf "51;E$vterm_elisp" - } - ''; }; } @@ -11029,7 +10874,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w
    -  { pkgs, ... }:
    +{ pkgs, ... }:
     let
       tmux-super-fingers = pkgs.tmuxPlugins.mkTmuxPlugin
         {
    @@ -12360,30 +12205,29 @@ in
             swayfxSettings = config.swarselsystems.swayfxConfig;
           in
           "
    -          exec_always autotiling
    -          set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
    -          mode $exit {
    +        exec_always autotiling
    +        set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
     
    -              bindsym --to-code {
    -                  s exec \"systemctl suspend\", mode \"default\"
    -                  l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize && systemctl suspend \", mode \"default \"
    -                  p exec \"systemctl poweroff\"
    -                  r exec \"systemctl reboot\"
    -                  u exec \"swaymsg exit\"
    +        mode $exit {
    +          bindsym --to-code {
    +            s exec \"systemctl suspend\", mode \"default\"
    +            l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize && systemctl suspend \", mode \"default \"
    +            p exec \"systemctl poweroff\"
    +            r exec \"systemctl reboot\"
    +            u exec \"swaymsg exit\"
     
    -                  Return mode \"default\"
    -                  Escape mode \"default\"
    -                  ${modifier}+Escape mode \"default\"
    -              }
    +            Return mode \"default\"
    +            Escape mode \"default\"
    +            ${modifier}+Escape mode \"default\"
               }
    +        }
     
    -          exec systemctl --user import-environment
    -          exec swayidle -w
    +        exec systemctl --user import-environment
    +        exec swayidle -w
     
     
    -          ${swayfxSettings}
    -
    -          ";
    +        ${swayfxSettings}
    +        ";
       };
     }
     
    @@ -12475,7 +12319,7 @@ let profilesPath = "${self}/profiles"; in { - imports = [ + imports = [ "${profilesPath}/common/home/settings.nix" ./symlink.nix ]; @@ -12686,38 +12530,38 @@ The rest of the settings is at
    (fset 'epg-wait-for-status (add-hook 'emacs-startup-hook (lambda () (progn - ;; (setq gc-cons-threshold (* 1000 1000 8) - ;; (setq gc-cons-threshold #x40000000 - (setq gc-cons-threshold (* 32 1024 1024) + (setq gc-cons-threshold (* 32 1024 1024) gc-cons-percentage 0.1 jit-lock-defer-time 0.05 read-process-output-max (* 1024 1024) @@ -13223,14 +13065,7 @@ Used here: General org-mode
     (defun swarsel/org-mode-setup ()
    -  ;; (org-indent-mode)
       (variable-pitch-mode 1)
    -  ;;(auto-fill-mode 0)
    -  ;; (setq display-line-numbers-type 'relative
    -  ;;       display-line-numbers-current-absolute 1
    -  ;;       display-line-numbers-width-start nil
    -  ;;       display-line-numbers-width 6
    -  ;;       display-line-numbers-grow-only 1)
       (add-hook 'org-tab-first-hook 'org-end-of-line)
       (visual-line-mode 1))
     
    @@ -13283,20 +13118,20 @@ We set a hook that runs everytime we save the file. It would be a bit more effic
       (let ((default-directory (expand-file-name "~/.dotfiles")))
         (shell-command "nixpkgs-fmt . > /dev/null")))
     
    -  (defun swarsel/org-babel-tangle-config ()
    +(defun swarsel/org-babel-tangle-config ()
       (interactive)
    -    (when (string-equal (buffer-file-name)
    -                        swarsel-swarsel-org-filepath)
    -      ;; Dynamic scoping to the rescue
    -      (let ((org-confirm-babel-evaluate nil))
    -        ;; (org-html-export-to-html)
    -        (org-babel-tangle)
    -        (swarsel/run-formatting)
    -        )))
    +  (when (string-equal (buffer-file-name)
    +                      swarsel-swarsel-org-filepath)
    +    ;; Dynamic scoping to the rescue
    +    (let ((org-confirm-babel-evaluate nil))
    +      ;; (org-html-export-to-html)
    +      (org-babel-tangle)
    +      (swarsel/run-formatting)
    +      )))
     
    -  (setq org-html-htmlize-output-type nil)
    +(setq org-html-htmlize-output-type nil)
     
    -  ;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
    +;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
     
     
    @@ -13362,54 +13197,12 @@ These functions are used here: -
    -
    -
    -
    -
    4.2.1.14. python shell reloading
    -
    -

    -The standard Emacs behaviour for the Python process shell is a bit annoying. This is my attempt at making it show automatically on opening a python buffer and making it refresh on its own as well. This does not nicely work yet. -

    - -
    -
    -;; run the python inferior shell immediately upon entering a python buffer
    -;; (add-hook 'python-mode-hook 'swarsel/run-python)
    -
    -;; (defun swarsel/run-python ()
    -;;   (save-selected-window
    -;;     (switch-to-buffer-other-window (process-buffer (python-shell-get-or-create-process (python-shell-parse-command))))))
    -
    -;; reload python shell automatically
    -(defun my-python-shell-run ()
    -  (interactive)
    -  (when (get-buffer-process "*Python*")
    -    (set-process-query-on-exit-flag (get-buffer-process "*Python*") nil)
    -    (kill-process (get-buffer-process "*Python*"))
    -    ;; Uncomment If you want to clean the buffer too.
    -    ;;(kill-buffer "*Python*")
    -    ;; Not so fast!
    -    (sleep-for 0.5))
    -  (run-python (python-shell-parse-command) nil nil)
    -  (python-shell-send-buffer)
    -  ;; Pop new window only if shell isnt visible
    -  ;; in any frame.
    -  (unless (get-buffer-window "*Python*" t)
    -    (python-shell-switch-to-shell)))
    -
    -(defun my-python-shell-run-region ()
    -  (interactive)
    -  (python-shell-send-region (region-beginning) (region-end))
    -  (python-shell-switch-to-shell))
    -
     
    -
    4.2.1.15. Nix common prefix bracketer
    +
    4.2.1.14. Nix common prefix bracketer

    This function searches for common delimiters in region and removes them, summarizing all captured lines by it. @@ -13443,7 +13236,7 @@ This function searches for common delimiters in region and removes them, summari

    -
    4.2.1.16. Nix formatters
    +
    4.2.1.15. Nix formatters

    This formats the org code block at point in accordance to the nixpkgs-fmt formatter @@ -13457,30 +13250,30 @@ This formats the org code block at point in accordance to the

    -
    4.2.1.17. Disable garbace collection while minibuffer is active
    +
    4.2.1.16. Disable garbace collection while minibuffer is active
    @@ -13512,126 +13305,112 @@ I also define some keybinds to some combinations directly. Those are used mostly
     
     
    -  ;; Make ESC quit prompts
    -  (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
    +;; Make ESC quit prompts
    +(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
     
    -  ;; Set up general keybindings
    -  (use-package general
    -    :config
    -    (general-create-definer swarsel/leader-keys
    -      :keymaps '(normal insert visual emacs)
    -      :prefix "SPC"
    -      :global-prefix "C-SPC")
    +;; Set up general keybindings
    +(use-package general
    +  :config
    +  (general-create-definer swarsel/leader-keys
    +    :keymaps '(normal insert visual emacs)
    +    :prefix "SPC"
    +    :global-prefix "C-SPC")
     
    -    (swarsel/leader-keys
    -      "e"  '(:ignore e :which-key "evil")
    -      "eo" '(evil-jump-backward :which-key "cursor jump backwards")
    -      "eO" '(evil-jump-forward :which-key "cursor jump forwards")
    -      "t"  '(:ignore t :which-key "toggles")
    -      "ts" '(hydra-text-scale/body :which-key "scale text")
    -      "te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
    -      "tl" '(display-line-numbers-mode :which-key "line numbers")
    -      "tp" '(evil-cleverparens-mode :wk "cleverparens")
    -      "to" '(olivetti-mode :wk "olivetti")
    -      "td" '(darkroom-tentative-mode :wk "darkroom")
    -      "tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
    -      "m"  '(:ignore m :which-key "modes/programs")
    -      "mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
    -      "mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
    -      "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
    -      "mp" '(popper-toggle :which-key "popper")
    -      "md" '(dirvish :which-key "dirvish")
    -      "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed")
    -      "o"  '(:ignore o :which-key "org")
    -      "op" '((lambda () (interactive) (org-present)) :which-key "org-present")
    -      "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda")
    -      "oa" '((lambda () (interactive) (org-refile)) :which-key "org-refile")
    -      "ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
    -      "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
    -      "oc" '((lambda () (interactive) (org-store-link)) :which-key "copy (=store) link")
    -      "os" '(shfmt-region :which-key "format sh-block")
    -      "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
    -      "on" '(nixpkgs-fmt-region :which-key "format nix-block")
    -      "ot" '(swarsel/org-babel-tangle-config :which-key "tangle file")
    -      "oe" '(org-html-export-to-html :which-key "export to html")
    -      "c"  '(:ignore c :which-key "capture")
    -      "ct" '((lambda () (interactive) (org-capture nil "tt")) :which-key "task")
    -      ;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
    -      ;; "cs" '(markdown-download-screenshot :which-key "screenshot")
    -      "l"  '(:ignore l :which-key "links")
    -      "lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
    -      "le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
    -      "ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
    -      "ls" '((lambda () (interactive) (find-file "/smb:Swarsel@winters:")) :which-key "Server")
    -      "lo" '(dired swarsel-obsidian-vault-directory :which-key "obsidian")
    -      ;; "la" '((lambda () (interactive) (find-file swarsel-org-anki-filepath)) :which-key "anki")
    -      ;; "ln" '((lambda () (interactive) (find-file swarsel-nix-org-filepath)) :which-key "Nix.org")
    -      "lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
    -      "lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
    -      ;; "a"   '(:ignore a :which-key "anki")
    -      ;; "ap"  '(anki-editor-push-tree :which-key "push new cards")
    -      ;; "an"  '((lambda () (interactive) (org-capture nil "a")) :which-key "new card")
    -      ;; "as"  '(swarsel-anki-set-deck-and-notetype :which-key "change deck and notetype")
    -      "h"   '(:ignore h :which-key "help")
    -      "hy"  '(yas-describe-tables :which-key "yas tables")
    -      "hb"  '(embark-bindings :which-key "current key bindings")
    -      "h"   '(:ignore t :which-key "describe")
    -      "he"  'view-echo-area-messages
    -      "hf"  'describe-function
    -      "hF"  'describe-face
    -      "hl"  '(view-lossage :which-key "show command keypresses")
    -      "hL"  'find-library
    -      "hm"  'describe-mode
    -      "ho"  'describe-symbol
    -      "hk"  'describe-key
    -      "hK"  'describe-keymap
    -      "hp"  'describe-package
    -      "hv"  'describe-variable
    -      "hd"  'devdocs-lookup
    -      "w"   '(:ignore t :which-key "window")
    -      "wl"  'windmove-right
    -      "w <right>"  'windmove-right
    -      "wh"  'windmove-left
    -      "w <left>"  'windmove-left
    -      "wk"  'windmove-up
    -      "w <up>"  'windmove-up
    -      "wj"  'windmove-down
    -      "w <down>"  'windmove-down
    -      "wr"  'winner-redo
    -      "wd"  'delete-window
    -      "w="  'balance-windows-area
    -      "wD"  'kill-buffer-and-window
    -      "wu"  'winner-undo
    -      "wr"  'winner-redo
    -      "w/"  'evil-window-vsplit
    -"w\\"  'evil-window-vsplit
    -      "w-"  'evil-window-split
    -      "wm"  '(delete-other-windows :wk "maximize")
    -      "<right>" 'up-list
    -      "<left>" 'down-list
    -      ))
    +  (swarsel/leader-keys
    +    "e"  '(:ignore e :which-key "evil")
    +    "eo" '(evil-jump-backward :which-key "cursor jump backwards")
    +    "eO" '(evil-jump-forward :which-key "cursor jump forwards")
    +    "t"  '(:ignore t :which-key "toggles")
    +    "ts" '(hydra-text-scale/body :which-key "scale text")
    +    "te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
    +    "tl" '(display-line-numbers-mode :which-key "line numbers")
    +    "tp" '(evil-cleverparens-mode :wk "cleverparens")
    +    "to" '(olivetti-mode :wk "olivetti")
    +    "td" '(darkroom-tentative-mode :wk "darkroom")
    +    "tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
    +    "m"  '(:ignore m :which-key "modes/programs")
    +    "mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
    +    "mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
    +    "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
    +    "mp" '(popper-toggle :which-key "popper")
    +    "md" '(dirvish :which-key "dirvish")
    +    "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed")
    +    "o"  '(:ignore o :which-key "org")
    +    "op" '((lambda () (interactive) (org-present)) :which-key "org-present")
    +    "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda")
    +    "oa" '((lambda () (interactive) (org-refile)) :which-key "org-refile")
    +    "ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
    +    "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
    +    "oc" '((lambda () (interactive) (org-store-link)) :which-key "copy (=store) link")
    +    "os" '(shfmt-region :which-key "format sh-block")
    +    "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
    +    "on" '(nixpkgs-fmt-region :which-key "format nix-block")
    +    "ot" '(swarsel/org-babel-tangle-config :which-key "tangle file")
    +    "oe" '(org-html-export-to-html :which-key "export to html")
    +    "c"  '(:ignore c :which-key "capture")
    +    "ct" '((lambda () (interactive) (org-capture nil "tt")) :which-key "task")
    +    "l"  '(:ignore l :which-key "links")
    +    "lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
    +    "le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
    +    "ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
    +    "lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
    +    "lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
    +    "h"   '(:ignore h :which-key "help")
    +    "hy"  '(yas-describe-tables :which-key "yas tables")
    +    "hb"  '(embark-bindings :which-key "current key bindings")
    +    "h"   '(:ignore t :which-key "describe")
    +    "he"  'view-echo-area-messages
    +    "hf"  'describe-function
    +    "hF"  'describe-face
    +    "hl"  '(view-lossage :which-key "show command keypresses")
    +    "hL"  'find-library
    +    "hm"  'describe-mode
    +    "ho"  'describe-symbol
    +    "hk"  'describe-key
    +    "hK"  'describe-keymap
    +    "hp"  'describe-package
    +    "hv"  'describe-variable
    +    "hd"  'devdocs-lookup
    +    "w"   '(:ignore t :which-key "window")
    +    "wl"  'windmove-right
    +    "w <right>"  'windmove-right
    +    "wh"  'windmove-left
    +    "w <left>"  'windmove-left
    +    "wk"  'windmove-up
    +    "w <up>"  'windmove-up
    +    "wj"  'windmove-down
    +    "w <down>"  'windmove-down
    +    "wr"  'winner-redo
    +    "wd"  'delete-window
    +    "w="  'balance-windows-area
    +    "wD"  'kill-buffer-and-window
    +    "wu"  'winner-undo
    +    "wr"  'winner-redo
    +    "w/"  'evil-window-vsplit
    +    "w\\"  'evil-window-vsplit
    +    "w-"  'evil-window-split
    +    "wm"  '(delete-other-windows :wk "maximize")
    +    "<right>" 'up-list
    +    "<left>" 'down-list
    +    ))
     
    -  ;; General often used hotkeys
    -  (general-define-key
    -   "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
    -   ;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist
    -   ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards
    -   ;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot
    -   "C-c d" 'crux-duplicate-current-line-or-region
    -   "C-c D" 'crux-duplicate-and-comment-current-line-or-region
    -   "<DUMMY-m>" 'swarsel/last-buffer
    -   "M-\\" 'indent-region
    -   "C-<f9>" 'my-python-shell-run
    -   "<Paste>" 'yank
    -   "<Cut>" 'kill-region
    -   "<Copy>" 'kill-ring-save
    -   "<undo>" 'evil-undo
    -   "<redo>" 'evil-redo
    -   "C-S-c C-S-c" 'mc/edit-lines
    -   "C->" 'mc/mark-next-like-this
    -   "C-<" 'mc/mark-previous-like-this
    -   "C-c C-<" 'mc/mark-all-like-this
    -   )
    +;; General often used hotkeys
    +(general-define-key
    + "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
    + "C-c d" 'crux-duplicate-current-line-or-region
    + "C-c D" 'crux-duplicate-and-comment-current-line-or-region
    + "<DUMMY-m>" 'swarsel/last-buffer
    + "M-\\" 'indent-region
    + "<Paste>" 'yank
    + "<Cut>" 'kill-region
    + "<Copy>" 'kill-ring-save
    + "<undo>" 'evil-undo
    + "<redo>" 'evil-redo
    + "C-S-c C-S-c" 'mc/edit-lines
    + "C->" 'mc/mark-next-like-this
    + "C-<" 'mc/mark-previous-like-this
    + "C-c C-<" 'mc/mark-all-like-this
    + )
     
     
     
    @@ -13648,41 +13427,15 @@ In this section I setup some aliases that I use for various directories on my sy
     ;; set Nextcloud directory for journals etc.
    -(setq swarsel-sync-directory "~/Nextcloud"
    -      swarsel-emacs-directory "~/.emacs.d"
    -      swarsel-dotfiles-directory "~/.dotfiles"
    -      swarsel-projects-directory "~/Documents/GitHub")
    -
    -(setq swarsel-emacs-org-filepath (expand-file-name "Emacs.org" swarsel-dotfiles-directory)
    -      swarsel-nix-org-filepath (expand-file-name "Nix.org" swarsel-dotfiles-directory)
    -      swarsel-swarsel-org-filepath (expand-file-name "SwarselSystems.org" swarsel-dotfiles-directory)
    -      )
    -
    -
    -;; set Emacs main configuration .org names
    -(setq swarsel-emacs-org-file "Emacs.org"
    -      swarsel-anki-org-file "Anki.org"
    -      swarsel-tasks-org-file "Tasks.org"
    -      swarsel-archive-org-file "Archive.org"
    -      swarsel-org-folder-name "Org"
    -      swarsel-obsidian-daily-folder-name "⭐ Personal/Journal"
    -      swarsel-obsidian-folder-name "Obsidian"
    -      swarsel-obsidian-vault-name "Main")
    -
    -
    -;; set directory paths
    -(setq swarsel-org-directory (expand-file-name swarsel-org-folder-name  swarsel-sync-directory)) ; path to org folder
    -(setq swarsel-obsidian-directory (expand-file-name swarsel-obsidian-folder-name swarsel-sync-directory)) ; path to obsidian
    -(setq swarsel-obsidian-vault-directory (expand-file-name swarsel-obsidian-vault-name swarsel-obsidian-directory)) ; path to obsidian vault
    -(setq swarsel-obsidian-daily-directory (expand-file-name swarsel-obsidian-daily-folder-name swarsel-obsidian-vault-directory)) ; path to obsidian daily folder
    -
    -;; filepaths to certain documents
    -(setq swarsel-org-anki-filepath (expand-file-name swarsel-anki-org-file swarsel-org-directory) ; path to anki export file
    -      swarsel-org-tasks-filepath (expand-file-name swarsel-tasks-org-file swarsel-org-directory)
    -      swarsel-org-archive-filepath (expand-file-name swarsel-archive-org-file swarsel-org-directory))
    -
    -
    -
    +(setq
    + swarsel-emacs-directory "~/.emacs.d"
    + swarsel-dotfiles-directory "~/.dotfiles"
    + swarsel-swarsel-org-filepath (expand-file-name "SwarselSystems.org" swarsel-dotfiles-directory)
    + swarsel-tasks-org-file "Tasks.org"
    + swarsel-archive-org-file "Archive.org"
    + swarsel-work-projects-directory "~/Documents/Work"
    + swarsel-private-projects-directory "~/Documents/Private"
    + )
     
    @@ -13748,7 +13501,7 @@ Many people dislike the Emacs backup files; I do enjoy them, but have to admit t

    4.3. General init.el setup + UI

    -In this general section I have settings that I either consider to be integral to my experience when using emacs or have no other section that I feel they belong to. +In this general section I have settings that I either consider to be integral to my experience when using Emacs or have no other section that I feel they belong to.

    @@ -13877,8 +13630,8 @@ This sets up automatic garbage collection when the frame is unused. (run-with-idle-timer 15 t (lambda () ;; (message "Garbage Collector has run for %.06fsec" - (k-time (garbage-collect))))) - ;; ) + (k-time (garbage-collect))))) +;; )
    @@ -14086,6 +13839,18 @@ This minor-mode adds functionality for doing better surround-commands; for examp :config (global-evil-surround-mode 1)) + +
    +
    +
    +
    +
    4.3.7.6. evil-visual-mark-mode
    +
    +
    +
    +(use-package evil-visual-mark-mode
    +  :config (evil-visual-mark-mode))
    +
     
    @@ -14129,7 +13894,6 @@ Here I define my fonts to be used. Honestly I do not understand the face-attribu :weight 'regular :height 1.06) -;; these settings used to be in custom.el
    @@ -14200,7 +13964,6 @@ This minor mode allows mixing fixed and variable pitch fonts within the same buf :hook (text-mode . mixed-pitch-mode)) -
    @@ -14227,7 +13990,6 @@ I have currently disabled this in favor of
     ;; (setq auth-sources '( "~/.emacs.d/.caldav" "~/.emacs.d/.authinfo.gpg")
    -      ;; auth-source-cache-expiry nil) ; default is 2h
    +;; auth-source-cache-expiry nil) ; default is 2h
     
     (setq auth-sources '( "~/.emacs.d/.authinfo")
           auth-source-cache-expiry nil)
    @@ -14679,157 +14440,29 @@ This part of the configuration mostly makes some aesthetic changes, enables neat
       (setq org-startup-folded t)
       (setq org-support-shift-select t)
     
    -  ;; (setq org-agenda-start-with-log-mode t)
    -  ;; (setq org-log-done 'time)
    -  ;; (setq org-log-into-drawer t)
    +  (setq org-agenda-start-with-log-mode t)
    +  (setq org-log-done 'time)
    +  (setq org-log-into-drawer t)
       (setq org-startup-with-inline-images t)
       (setq org-export-headline-levels 6)
       (setq org-image-actual-width nil)
       (setq org-format-latex-options '(:foreground "White" :background default :scale 2.0 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")))
     
    -
    -
    -
    -
    -
    -
    4.4.1.2. org-agenda
    -
    -

    -Here I setup a plethora of keywords, keybinds and paths to give my org-agenda more power. -

    + (setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org" + "/home/swarsel/Nextcloud/Org/Archive.org" + )) -
    -
    -(setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org"
    -                         "/home/swarsel/Nextcloud/Org/Archive.org"
    -                         "/home/swarsel/Nextcloud/Org/Anki.org"
    -                         "/home/swarsel/Calendars/leon_cal.org"))
    -
    -(setq org-refile-targets
    -      '((swarsel-archive-org-file :maxlevel . 1)
    -        (swarsel-anki-org-file :maxlevel . 1)
    -        (swarsel-tasks-org-file :maxlevel . 1)))
    -
    -(setq org-todo-keywords
    -      '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
    -        (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
    -
    -
    -;; Configure custom agenda views
    -(setq org-agenda-custom-commands
    -      '(("d" "Dashboard"
    -         ((agenda "" ((org-deadline-warning-days 7)))
    -          (todo "NEXT"
    -                ((org-agenda-overriding-header "Next Tasks")))
    -          (tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
    -
    -        ("n" "Next Tasks"
    -         ((todo "NEXT"
    -                ((org-agenda-overriding-header "Next Tasks")))))
    -
    -        ("W" "Work Tasks" tags-todo "+work-email")
    -
    -
    -        ("w" "Workflow Status"
    -         ((todo "WAIT"
    -                ((org-agenda-overriding-header "Waiting on External")
    -                 (org-agenda-files org-agenda-files)))
    -          (todo "REVIEW"
    -                ((org-agenda-overriding-header "In Review")
    -                 (org-agenda-files org-agenda-files)))
    -          (todo "PLAN"
    -                ((org-agenda-overriding-header "In Planning")
    -                 (org-agenda-todo-list-sublevels nil)
    -                 (org-agenda-files org-agenda-files)))
    -          (todo "BACKLOG"
    -                ((org-agenda-overriding-header "Project Backlog")
    -                 (org-agenda-todo-list-sublevels nil)
    -                 (org-agenda-files org-agenda-files)))
    -          (todo "READY"
    -                ((org-agenda-overriding-header "Ready for Work")
    -                 (org-agenda-files org-agenda-files)))
    -          (todo "ACTIVE"
    -                ((org-agenda-overriding-header "Active Projects")
    -                 (org-agenda-files org-agenda-files)))
    -          (todo "COMPLETED"
    -                ((org-agenda-overriding-header "Completed Projects")
    -                 (org-agenda-files org-agenda-files)))
    -          (todo "CANC"
    -                ((org-agenda-overriding-header "Cancelled Projects")
    -                 (org-agenda-files org-agenda-files)))))))
    -
    -
    -
    -
    -
    -
    -
    -
    4.4.1.3. org capture templates
    -
    -

    -I wrote these capture templates to allow myself to quickly create Anki cards from within Emacs. I nearly never use this feature, but it cannot hurt to have. -

    - -
    -
    -(setq org-capture-templates
    -      `(
    -        ("a" "Anki basic"
    -         entry
    -         (file+headline swarsel-org-anki-filepath "Dispatch")
    -         (function swarsel-anki-make-template-string))
    -
    -        ("A" "Anki cloze"
    -         entry
    -         (file+headline org-swarsel-anki-file "Dispatch")
    -         "* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:ANKI_DECK: 🦁 All::01 ❤️ Various::00 ✨ Allgemein\n:END:\n** Text\n%?\n** Extra\n")
    -        ("t" "Tasks / Projects")
    -        ("tt" "Task" entry (file+olp swarsel-org-tasks-filepath "Inbox")
    -         "* TODO %?\n  %U\n  %a\n  %i" :empty-lines 1)
    -        ))
    -)
    -
    -
    -
    -
    -
    -
    4.4.1.4. Font Faces
    -
    -

    -Again, my understanding of the font-faces in Emacs is limited. This is mostly just tuned so that my org-files look acceptable. -

    - -
    -
    -
    -
    -;; Set faces for heading levels
    -(with-eval-after-load 'org-faces  (dolist (face '((org-level-1 . 1.1)
    -                                                  (org-level-2 . 0.9)
    -                                                  (org-level-3 . 0.9)
    -                                                  (org-level-4 . 0.9)
    -                                                  (org-level-5 . 0.9)
    -                                                  (org-level-6 . 0.9)
    -                                                  (org-level-7 . 0.9)
    -                                                  (org-level-8 . 0.9)))
    -                                    (set-face-attribute (car face) nil :font swarsel-alt-font :weight 'medium :height (cdr face)))
    -
    -                      ;; Ensure that anything that should be fixed-pitch in Org files appears that way
    -                      (set-face-attribute 'org-block nil   :inherit 'fixed-pitch)
    -                      (set-face-attribute 'org-table nil   :inherit 'fixed-pitch)
    -                      (set-face-attribute 'org-formula nil   :inherit 'fixed-pitch)
    -                      (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
    -                      (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
    -                      (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
    -                      (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
    -                      (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch))
    +  (setq org-refile-targets
    +        '((swarsel-archive-org-file :maxlevel . 1)
    +          (swarsel-tasks-org-file :maxlevel . 1)))
     
    +  )
     
    -
    4.4.1.5. org-appear
    +
    4.4.1.2. org-appear

    This package makes emphasis-markers appear when the cursor moves over them. Very useful as I enjoy the clean look of not always seeing them, but it is annoying not to be able to edit them properly. @@ -14850,7 +14483,7 @@ This package makes emphasis-markers appear when the cursor moves over them. Very

    -
    4.4.1.7. Fix headings not folding sometimes
    +
    4.4.1.4. Fix headings not folding sometimes

    There is a weird bug in org-mode that makes it so that headings were not folding correctly sometimes. This setting seems to fix it. @@ -14885,7 +14518,7 @@ There is a weird bug in org-mode that makes it so that headings were not folding

    -
    4.4.1.8. Babel
    +
    4.4.1.5. Babel

    org-babel allows to run blocks in other programming languages within an org-mode buffer, similar to what e.g. jupyterhub offers for python. @@ -14896,7 +14529,7 @@ It also offers a very useful utility of exporting org-mode buffers to different

    -
    4.4.1.8.1. Language Configuration
    +
    4.4.1.5.1. Language Configuration
    • This configures the languages that babel recognizes.
    • @@ -14905,25 +14538,39 @@ It also offers a very useful utility of exporting org-mode buffers to different
      (setq org-src-preserve-indentation nil)
       
      -  (org-babel-do-load-languages
      -   'org-babel-load-languages
      -   '((emacs-lisp . t)
      -     (python . t)
      -     (js . t)
      -     (shell . t)
      -     ))
      +(org-babel-do-load-languages
      + 'org-babel-load-languages
      + '((emacs-lisp . t)
      +   (python . t)
      +   (js . t)
      +   (shell . t)
      +   ))
       
      -  (push '("conf-unix" . conf-unix) org-src-lang-modes)
      +(push '("conf-unix" . conf-unix) org-src-lang-modes)
      +
      +(setq org-export-with-broken-links 'mark)
      +(setq org-confirm-babel-evaluate nil)
      +
      +;; tangle is too slow, try to speed it up
      +(defadvice org-babel-tangle-single-block (around inhibit-redisplay activate protect compile)
      +  "inhibit-redisplay and inhibit-message to avoid flicker."
      +  (let ((inhibit-redisplay t)
      +        (inhibit-message t))
      +    ad-do-it))
      +
      +(defadvice org-babel-tangle (around time-it activate compile)
      +  "Display the execution time"
      +  (let ((tim (current-time)))
      +    ad-do-it
      +    (message "org-tangle took %f sec" (float-time (time-subtract (current-time) tim)))))
       
      -  (setq org-export-with-broken-links 'mark)
      -  (setq org-confirm-babel-evaluate nil)
       
       
    -
    4.4.1.8.2. old easy structure templates
    +
    4.4.1.5.2. old easy structure templates
    • @@ -14949,7 +14596,7 @@ Usage: Type <, followed by one of the below keywords and press <

    -
    4.4.1.9. aucTex
    +
    4.4.1.6. aucTex

    This provides several utilities for LaTeX in Emacs, including many completions and convenience functions for math-mode. @@ -14977,7 +14624,7 @@ This provides several utilities for LaTeX in Emacs, including many completions a

    -
    4.4.1.10. org-download
    +
    4.4.1.7. org-download

    This package allows to download and copy images into org-mode buffers. Sadly it does not work in a very stable manner - if you copy images that are also links to another page (like is often the case in a Google image search), Emacs might crash from this. @@ -14985,27 +14632,13 @@ This package allows to download and copy images into org-mode buffers. Sadly it

    -(use-package org-download
    -  :after org
    -  :defer nil
    -  :custom
    -  (org-download-method 'directory)
    -  (org-download-image-dir "./images")
    -  (org-download-heading-lvl 0)
    -  (org-download-timestamp "org_%Y%m%d-%H%M%S_")
    -  ;;(org-image-actual-width 500)
    -  (org-download-screenshot-method "grim -g \"$(slurp)\" %s")
    -  :bind
    -  ("C-M-y" . org-download-screenshot)
    -  :config
    -  (require 'org-download))
     
     
    -
    4.4.1.11. org-fragtog
    +
    4.4.1.8. org-fragtog

    This package automatically toggles LaTeX-fragments in org-files. It seems to also work in markdown-files which is a nice addition, as my Obsidian notes are held in markdown. @@ -15022,7 +14655,7 @@ This package automatically toggles LaTeX-fragments in org-files. It seems to als

    -
    4.4.1.12. org-modern
    +
    4.4.1.9. org-modern

    This just makes org-mode a little bit more beautiful, mostly by making the begin_src and end_src tags in source-blocks turn into more beautiful icons, as well as hiding #+ tags before them, as well as in the properties section of the file. @@ -15041,7 +14674,7 @@ This just makes org-mode a little bit more beautiful, mostly by making the

    -
    4.4.1.13. Presentations
    +
    4.4.1.10. Presentations

    Recently I have grown fond of holding presentations using Emacs :) @@ -15317,30 +14950,8 @@ Adds functions for formatting shellscripts.

    -
    -

    4.4.10. Olivetti

    -
    -

    -Olivetti is a mode specialized for writing prose in Emacs. I went for a very simple setup with little distractions. -

    - -

    -This mode is not automatically activated anywhere because I only rarely need it. -

    - -
    -
    -(use-package olivetti
    -  :init
    -  (setq olivetti-body-width 100)
    -  (setq olivetti-recall-visual-line-mode-entry-state t))
    -
    -
    -
    -
    -
    -

    4.4.11. elfeed

    +

    4.4.10. elfeed

    @@ -15372,30 +14983,12 @@ This mode is not automatically activated anywhere because I only rarely need it.
     (define-key elfeed-search-mode-map (kbd "k") 'previous-line)
     (define-key elfeed-show-mode-map (kbd "S-SPC") 'scroll-down-command)
     
    -
    -
    -
    -
    -
    -

    4.4.12. darkroom

    -
    -

    -Darkroom is package that reduces all forms of distraction to a minimum - this can be useful when simply reading a file for example. For this mode I have increased the text scale by a large margin to make for comfortable reading -This mode is not automatically activated anywhere because I only rarely need it. -

    - -
    -
    -(use-package darkroom
    -  :init
    -  (setq darkroom-text-scale-increase 3))
    -
     
    -

    4.4.13. Ripgrep

    +

    4.4.11. Ripgrep

    This is the ripgrep command for Emacs. @@ -15410,7 +15003,7 @@ This is the ripgrep command for Emacs.

    -

    4.4.14. Tree-sitter

    +

    4.4.12. Tree-sitter

    Tree-sitter is a parsing library integrated into Emacs to provide better syntax highlighting and code analysis. It generates concrete syntax trees for source code, enabling more accurate and efficient text processing. Emacs' tree-sitter integration enhances language support, offering features like incremental parsing and precise syntax-aware editing. This improves the development experience by providing robust and dynamic syntax features, making it easier for me to navigate and manipulate code. @@ -15469,7 +15062,7 @@ In order to update the language grammars, run the next command below.

    -

    4.4.15. direnv (envrc)

    +

    4.4.13. direnv (envrc)

    @@ -15482,7 +15075,7 @@ In order to update the language grammars, run the next command below.
     
    -

    4.4.16. avy

    +

    4.4.14. avy

    avy provides the ability to search for any character on the screen (not only in the current buffer!) - I enjoy this utility a lot and use it possibly even more often than the native vim commands. @@ -15496,27 +15089,12 @@ In order to update the language grammars, run the next command below. :config (setq avy-all-windows 'all-frames)) - -

    -
    -
    -
    -

    4.4.17. crdt (Collaborative Editing)

    -
    -

    -With this it is possible to work on the same file collaboratively. I have never tried it out, but it sounds cool. -

    - -
    -
    -(use-package crdt)
    -
     
    -

    4.4.18. devdocs

    +

    4.4.15. devdocs

    devdocs is a very nice package that provides documentation from https:devdocs.io. This is very useful since e.g. pyright provides only a very bad documentation and I do not want to leave Emacs all the time just to read documentation. @@ -15552,7 +15130,7 @@ To install a documentation, use the devdocs=install command and sel

    -

    4.4.19. Projectile

    +

    4.4.16. Projectile

    projectile is useful for keeping track of your git projects within Emacs. I mostly use it to quickly switch between projects. @@ -15569,7 +15147,7 @@ projectile is useful for keeping track of your git projects within Emacs. I most :init ;; NOTE: Set this to the folder where you keep your Git repos! (when (file-directory-p swarsel-projects-directory) - (setq projectile-project-search-path (list swarsel-projects-directory))) + (setq projectile-project-search-path (list swarsel-work-projects-directory swarsel-private-projects-directory))) (setq projectile-switch-project-action #'magit-status)) @@ -15577,7 +15155,7 @@ projectile is useful for keeping track of your git projects within Emacs. I most

    -

    4.4.20. Magit

    +

    4.4.17. Magit

    magit is the best git utility I have ever used - it has a beautiful interface and is very verbose. Here I mostly just setup the list of repositories that I want to expost to magit. @@ -15591,9 +15169,8 @@ Also, Emacs needs a little extra love to accept my Yubikey for git commits etc.

     (use-package magit
       :config
    -  (setq magit-repository-directories `((,swarsel-projects-directory  . 1)
    -                                       (,swarsel-emacs-directory . 0)
    -                                       (,swarsel-obsidian-directory . 0)
    +  (setq magit-repository-directories `((,swarsel-work-projects-directory  . 1)
    +                                       (,swarsel-private-projects-directory . 1)
                                            ("~/.dotfiles/" . 0)))
       :custom
       (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) ; stay in the same window
    @@ -15602,7 +15179,7 @@ Also, Emacs needs a little extra love to accept my Yubikey for git commits etc.
     
    -

    4.4.21. Yubikey support

    +

    4.4.18. Yubikey support

    The following settings are needed to make sure emacs works for magit commits and pushes. It is not a beautiful solution since commiting uses pinentry-emacs and pushing uses pinentry-gtk2, but it works for now at least. @@ -15622,7 +15199,7 @@ The following settings are needed to make sure emacs works for magit commits and

    -

    4.4.22. Forge

    +

    4.4.19. Forge

    NOTE: Make sure to configure a GitHub token before using this package! @@ -15638,9 +15215,7 @@ NOTE: Make sure to configure a GitHub token before using this package!

    (1) in practice: github -<> settings -<> developer option -<> create classic token with repo; user; read:org permissions -(2) install GnuGP (and add to PATH) -(3) create ~/.authinfo.gpg with the following info scheme: -machine api.github.com login USERNAMEforge password 012345abcdef… +(2)machine api.github.com login USERNAMEforge password 012345abcdef…

    @@ -15651,16 +15226,13 @@ machine api.github.com login USERNAMEforge password 012345abcdef (with-eval-after-load 'forge (add-to-list 'forge-alist - '("sgit.iue.tuwien.ac.at" - "sgit.iue.tuwien.ac.at/api/v1" - "sgit.iue.tuwien.ac.at" - forge-gitea-repository))) + ))
    -

    4.4.23. git-timemachine

    +

    4.4.20. git-timemachine

    This is just a nice utility to browse different versions of a file of a git project within Emacs. @@ -15677,7 +15249,7 @@ This is just a nice utility to browse different versions of a file of a git proj

    -

    4.4.24. Delimiters (brackets): rainbow-delimiters, highlight-parentheses

    +

    4.4.21. Delimiters (brackets): rainbow-delimiters, highlight-parentheses

    • rainbow-delimiters colors all delimiters, also ones not in current selection
    • @@ -15720,7 +15292,7 @@ I am not completely sure on electric-pair-mode yet, sometimes it is very helpful
    -

    4.4.25. rainbow-mode

    +

    4.4.22. rainbow-mode

    Complimentary to the delimiters-packages above, this package sets the background color of the delimiters, which makes it easier to see at a glance where we are in a delimiter-tree. @@ -15736,7 +15308,7 @@ Complimentary to the delimiters-packages above, this package sets the background

    -

    4.4.26. Corfu

    +

    4.4.23. Corfu

    -

    4.4.27. cape

    +

    4.4.24. cape

    cape adds even more completion capabilities by adding a lot of completion logic that is exposed as separate functions. I tried out adding these to the completion-at-points-functions alist, but I felt like it cluttered my suggestions too much. Hence I now just call the respective functions when I need them. For this I setup the C-z keybinding in General evil. @@ -15836,22 +15402,6 @@ I leave the commented out alist extensions here in case I want to try them out a ("C-z ^" . cape-tex) ("C-z &" . cape-sgml) ("C-z r" . cape-rfc1345) - ;; Add to the global default value of `completion-at-point-functions' which is - ;; used by `completion-at-point'. The order of the functions matters, the - ;; first function returning a result wins. Note that the list of buffer-local - ;; completion functions takes precedence over the global list. - ;; (add-to-list 'completion-at-point-functions #'cape-dabbrev) - ;; (add-to-list 'completion-at-point-functions #'cape-file) - ;; (add-to-list 'completion-at-point-functions #'cape-elisp-block) - ;; (add-to-list 'completion-at-point-functions #'cape-history) - ;; (add-to-list 'completion-at-point-functions #'cape-keyword) - ;; (add-to-list 'completion-at-point-functions #'cape-tex) - ;; (add-to-list 'completion-at-point-functions #'cape-sgml) - ;; (add-to-list 'completion-at-point-functions #'cape-rfc1345) - ;; (add-to-list 'completion-at-point-functions #'cape-abbrev) - ;; (add-to-list 'completion-at-point-functions #'cape-dict) - ;; (add-to-list 'completion-at-point-functions #'cape-elisp-symbol) - ;; (add-to-list 'completion-at-point-functions #'cape-line) ) @@ -15859,7 +15409,7 @@ I leave the commented out alist extensions here in case I want to try them out a

    -

    4.4.28. rust

    +

    4.4.25. rust

    This sets up rustic-mode with tree-sitter support - there is still one issue to iron out with automatic adding of dependency crates, but everything else works fine now. @@ -15886,7 +15436,7 @@ This sets up rustic-mode with tree-sitter support - there is still one issue to

    -

    4.4.29. Tramp

    +

    4.4.26. Tramp

    Tramp allows for SSH access of files over Emacs. I have no ideas what the options here mean, but this is a recommended configuration that I found (sadly I lost the link). I need to research more what these options really do. @@ -15926,7 +15476,7 @@ Tramp allows for SSH access of files over Emacs. I have no ideas what the option

    -

    4.4.30. diff-hl

    +

    4.4.27. diff-hl

    This is a simple highlighting utility that uses the margin to visually show the differences since the last git commit. @@ -15948,7 +15498,7 @@ This is a simple highlighting utility that uses the margin to visually show the

    -

    4.4.31. Commenting

    +

    4.4.28. Commenting

    This package allows for swift commenting out and in of code snippets. For some reason, it is a bit broken in my config, as it sometimes comments out too much, sometimes too little, and sometimes it splits lines during commenting. Also, in org-mode when inside a src-block, it often times jumps to the top of the block. @@ -15967,94 +15517,8 @@ Still, this is avery convenient package.

    -
    -

    4.4.32. yasnippet

    -
    -

    -yasnippet allows to define snippets that can be quickly expanded by hitting the TAB key after inputting a keyword. -

    - -

    -I used to run this together with the yasnippet-snippets package, but the snippets in there I did not find all too useful for myself. I need to create some custom snippets here one day. -

    - -
    -
    -(use-package yasnippet
    -  :init (yas-global-mode 1)
    -  :config
    -  (yas-reload-all))
    -
    -
    -
    -
    -
    -
    4.4.32.0.1. yasnippet math-snippets
    -
    -

    -The following block is mostly inspired from https://code.kulupu.party/thesuess/WTFmacs/ and sets up a few prefixes that make LaTeX-math-mode nicer to use even with auctex and cape enabled. -

    - -
    -
    -
    -(setq wtf/latex-mathbb-prefix "''")
    -(setq swarsel/latex-mathcal-prefix "``")
    -
    -(use-package yasnippet
    -  :config
    -
    -  (setq wtf/english-alphabet
    -        '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"))
    -
    -  (dolist (elem wtf/english-alphabet)
    -    (when (string-equal elem (downcase elem))
    -      (add-to-list 'wtf/english-alphabet (upcase elem))))
    -
    -
    -  (yas-define-snippets
    -   'latex-mode
    -   (mapcar
    -    (lambda (elem)
    -      (list (concat wtf/latex-mathbb-prefix elem) (concat "\\mathbb{" elem "}") (concat "Mathbb letter " elem)))
    -    wtf/english-alphabet))
    -
    -  (yas-define-snippets
    -   'latex-mode
    -   (mapcar
    -    (lambda (elem)
    -      (list (concat swarsel/latex-mathcal-prefix elem) (concat "\\mathcal{" elem "}") (concat "Mathcal letter " elem)))
    -    wtf/english-alphabet))
    -
    -  (setq swtf/latex-math-symbols
    -        '(("x" . "\\times")
    -          ("*" . "\\cdot")
    -          ("." . "\\ldots")
    -          ("op" . "\\operatorname{$1}$0")
    -          ("o" . "\\circ")
    -          ("V" . "\\forall")
    -          ("v" . "\\vee")
    -          ("w" . "\\wedge")
    -          ("q" . "\\quad")
    -          ("f" . "\\frac{$1}{$2}$0")
    -          ("s" . "\\sum_{$1}^{$2}$0")
    -          ("p" . "\\prod_{$1}^{$2}$0")
    -          ("e" . "\\exists")
    -          ("i" . "\\int_{$1}^{$2}$0")
    -          ("c" . "\\cap")
    -          ("u" . "\\cup")
    -          ("0" . "\\emptyset")))
    -
    -  )
    -
    -
    -
    -
    -
    -
    -
    -

    4.4.33. eglot

    +

    4.4.29. eglot

    After having tried out lsp-mode and lsp-bridge for a while each, I must say that eglot feels the most clean and fast to me. @@ -16066,7 +15530,7 @@ After having tried out lsp-mode and lsp-bridge for a w (use-package eglot :config (add-to-list 'eglot-server-programs - '(yaml-ts-mode . ("ansible-language-server" "--stdio"))) + '(yaml-ts-mode . ("ansible-language-server" "--stdio"))) :hook ((python-mode python-ts-mode @@ -16109,7 +15573,7 @@ After having tried out lsp-mode and lsp-bridge for a w

    -

    4.4.34. sideline-flymake

    +

    4.4.30. sideline-flymake

    This brings back warnings and errors on the sideline for eglot; a feature that I have been missing from lsp-mode for a while. @@ -16121,32 +15585,15 @@ This brings back warnings and errors on the sideline for eglot; a feature that I :hook (flymake-mode . sideline-mode) :init (setq sideline-flymake-display-mode 'point) ; 'point to show errors only on point - ; 'line to show errors on the current line + ; 'line to show errors on the current line (setq sideline-backends-right '(sideline-flymake))) - -

    -
    -
    -
    -

    4.4.35. Breadcrumb

    -
    -

    -This simple shows the path to the current file on the top of the buffer - I just think it looks kind of neat, even though it is not extremely useful :) -

    - -
    -
    -(use-package breadcrumb
    -  ;; :config (breadcrumb-mode)
    -  )
    -
     
    -

    4.4.36. Prevent breaking of hardlinks

    +

    4.4.31. Prevent breaking of hardlinks

    This setting ensures that hard links are preserved during the backup process, which is useful for maintaining the integrity of files that are linked in multiple locations. @@ -16161,7 +15608,7 @@ This setting ensures that hard links are preserved during the backup process, wh

    -

    4.4.37. Dirvish

    +

    4.4.32. Dirvish

    Dirvish is an improvement upon the dired-framework and has more features like file preview etc. Sadly it has an incompatibility with openwith which is why I have disabled that package. @@ -16220,46 +15667,12 @@ Dirvish is an improvement upon the dired-framework and has more features like fi ("M-e" . dirvish-emerge-menu) ("M-j" . dirvish-fd-jump))) - -

    -
    -
    -
    -

    4.4.38. pdf-tools: pdf-viewer and support for dirvish

    -
    -

    -This enables pdf-previewing in dirvish and gives a much better pdf-viewer than is shipped normally by emacs. -

    - -
    -
    -;; (use-package pdf-tools
    -;;   :init
    -;;   (if (not (boundp 'pdf-tools-directory))
    -;;       (pdf-tools-install))
    -;;   :mode ("\\.pdf" . pdf-view-mode))
    -
    -
    -
    -
    -
    -
    -

    4.4.39. Jupyter

    -
    -

    -This is a jupyter client. Using it is a bit cumbersome though, so I have not fully explored all features. -

    - -
    -
    -(use-package ein)
    -
     
    -

    4.4.40. undo-tree

    +

    4.4.33. undo-tree

    Base emacs undo logic is very useful, but not easy to understand for me. I prefer undo-tree, which makes switching between branches easier and also allows quickly switching back to a much older state using the visualizer. @@ -16289,16 +15702,12 @@ While we are at it, we are also setting up a persistent undo-file for every file :config (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))) -;; (add-hook 'prog-mode-hook 'undo-tree-mode) -;; (add-hook 'text-mode-hook 'undo-tree-mode) -;; (add-hook 'org-mode-hook 'undo-tree-mode) -;; (add-hook 'latex-mode-hook 'undo-tree-mode)

    -

    4.4.41. Hydra

    +

    4.4.34. Hydra

    Hydra allows for the writing of macro-style functions. I have not yet looked into this all too much, but it seems to be a potent feature. @@ -16312,7 +15721,7 @@ Hydra allows for the writing of macro-style functions. I have not yet looked int

    -
    4.4.41.1. Text scaling
    +
    4.4.34.1. Text scaling

    I only wrote this in order to try out hydra; rarely do I really need this. However, it can be useful for Presentations. It simply scales the text size. @@ -16333,185 +15742,12 @@ I only wrote this in order to try out hydra; rarely do I really need this. Howev

    -
    -

    4.4.42. External Applications

    -
    -
    -
    -
    4.4.42.1. Obsidian
    -
    -

    -This provides an interface to Obsidian for Emacs - as much as I want to like it, I actually enjoy using the official Obsidian app more - even though that cannot be used by Emacs directly. -

    - -

    -My workflow for Obsidian is now as follows: -

    - -
      -
    1. create notes either in Emacs or Obsidian
    2. -
    3. -look at them in the official client -

      - -

      -I hope that this package will improve, then I will come back to it one day. -

    4. -
    - -
    -
    -;; (use-package obsidian
    -;;   :ensure t
    -;;   :demand t
    -;;   :config
    -;;   (obsidian-specify-path swarsel-obsidian-vault-directory)
    -;;   (global-obsidian-mode t)
    -;;   :custom
    -;;   ;; This directory will be used for `obsidian-capture' if set.
    -;;   (obsidian-inbox-directory "Inbox")
    -;;   (bind-key (kbd "C-c M-o") 'obsidian-hydra/body 'obsidian-mode-map)
    -;;   :bind (:map obsidian-mode-map
    -;;               ;; Replace C-c C-o with Obsidian.el's implementation. It's ok to use another key binding.
    -;;               ("C-c C-o" . obsidian-follow-link-at-point)
    -;;               ;; Jump to backlinks
    -;;               ("C-c C-b" . obsidian-backlink-jump)
    -;;               ;; If you prefer you can use `obsidian-insert-link'
    -;;               ("C-c C-l" . obsidian-insert-wikilink)))
    -
    -
    -
    -
    -
    -
    -
    4.4.42.2. Anki
    -
    -

    -This section is here to make Anki usable from within Emacs - an endeavour that I have mostly given up on. -

    -
    -
    -
    4.4.42.2.1. Basic Anki setup
    -
    -
    -
    -;; (use-package anki-editor
    -;;   :after org
    -;;   :bind (:map org-mode-map
    -;;               ("<f12>" . anki-editor-cloze-region-auto-incr)
    -;;               ("<f11>" . anki-editor-cloze-region-dont-incr)
    -;;               ("<f10>" . anki-editor-reset-cloze-number)
    -;;               ("<f9>"  . anki-editor-push-tree))
    -;;   :hook (org-capture-after-finalize . anki-editor-reset-cloze-number) ; Reset cloze-number after each capture.
    -;;   :config
    -;;   (setq anki-editor-create-decks t ;; Allow anki-editor to create a new deck if it doesn't exist
    -;;         anki-editor-org-tags-as-anki-tags t)
    -
    -;;   (defun anki-editor-cloze-region-auto-incr (&optional arg)
    -;;     "Cloze region without hint and increase card number."
    -;;     (interactive)
    -;;     (anki-editor-cloze-region swarsel-anki-editor-cloze-number "")
    -;;     (setq swarsel-anki-editor-cloze-number (1+ swarsel-anki-editor-cloze-number))
    -;;     (forward-sexp))
    -;;   (defun anki-editor-cloze-region-dont-incr (&optional arg)
    -;;     "Cloze region without hint using the previous card number."
    -;;     (interactive)
    -;;     (anki-editor-cloze-region (1- swarsel-anki-editor-cloze-number) "")
    -;;     (forward-sexp))
    -;;   (defun anki-editor-reset-cloze-number (&optional arg)
    -;;     "Reset cloze number to ARG or 1"
    -;;     (interactive)
    -;;     (setq swarsel-anki-editor-cloze-number (or arg 1)))
    -;;   (defun anki-editor-push-tree ()
    -;;     "Push all notes under a tree."
    -;;     (interactive)
    -;;     (anki-editor-push-notes '(4))
    -;;     (anki-editor-reset-cloze-number))
    -;;   ;; Initialize
    -;;   (anki-editor-reset-cloze-number)
    -;;   )
    -
    -;; (require 'anki-editor)
    -
    -
    -
    -
    -
    -
    -
    4.4.42.2.2. Own Anki functions
    -
    -
      -
    • These functions enable you to quickly set the destination note type and deck
    • -
    - -
    -
    -;; (defvar swarsel-anki-deck nil)
    -;; (defvar swarsel-anki-notetype nil)
    -;; (defvar swarsel-anki-fields nil)
    -
    -;; (defun swarsel-anki-set-deck-and-notetype ()
    -;;   (interactive)
    -;;   (setq swarsel-anki-deck  (completing-read "Choose a deck: "
    -;;                                             (sort (anki-editor-deck-names) #'string-lessp)))
    -;;   (setq swarsel-anki-notetype (completing-read "Choose a note type: "
    -;;                                                (sort (anki-editor-note-types) #'string-lessp)))
    -;;   (setq swarsel-anki-fields (progn
    -;;                               (anki-editor--anki-connect-invoke-result "modelFieldNames" `((modelName . ,swarsel-anki-notetype)))))
    -;;   )
    -
    -;; (defun swarsel-anki-make-template-string ()
    -;;   (if (not swarsel-anki-deck)
    -;;       (call-interactively 'swarsel-anki-set-deck-and-notetype))
    -;;   (setq swarsel-temp swarsel-anki-fields)
    -;;   (concat (concat "* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: " swarsel-anki-notetype "\n:ANKI_DECK: " swarsel-anki-deck "\n:END:\n** ")(pop swarsel-temp) "\n%?\n** " (mapconcat 'identity swarsel-temp "\n\n** ") "\n\n"))
    -
    -;; (defun swarsel-today()
    -;;   (format-time-string "%Y-%m-%d"))
    -
    -;; (defun swarsel-obsidian-daily ()
    -;;   (interactive)
    -;;   (if (not (file-exists-p (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
    -;;       (write-region "" nil (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory))
    -;;     )
    -;;   (find-file (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
    -
    -
    -
    -
    -
    -
    -
    -

    4.4.43. Email

    +

    4.4.35. Email

    -
    -
    4.4.43.1. make sure mu4e is found
    -
    -

    -This seems not to be needed - I do not yet dare to delete it though. -

    - -
    -
    -;; (let ((mu4epath
    -;;        (concat
    -;;         (f-dirname
    -;;          (file-truename
    -;;           (executable-find "mu")))
    -;;         "/../share/emacs/site-lisp/mu4e")))
    -;;   (when (and
    -;;          (string-prefix-p "/nix/store/" mu4epath)
    -;;          (file-directory-p mu4epath))
    -;;     (add-to-list 'load-path mu4epath)))
    -
    -
    -
    -
    -
    -
    4.4.43.2. mu4e
    +
    4.4.35.1. mu4e

    In this section we are setting up mu4e, a mail client for emacs using mu with mbsync as backend. The mail accounts themselves are setup in the NixOS configuration, so we only need to add Emacs specific settings here. @@ -16573,7 +15809,7 @@ The hook functions are defined here: -

    4.4.43.3. mu4e-alert
    +
    4.4.35.2. mu4e-alert

    This adds the simple utility of sending desktop notifications whenever a new mail is received. I am using libnotify because I want to use this with notify-send. @@ -16594,7 +15830,7 @@ This adds the simple utility of sending desktop notifications whenever a new mai

    -

    4.4.44. Calendar

    +

    4.4.36. Calendar

    This provides a beautiful calender to emacs. @@ -16662,7 +15898,7 @@ Yes, I am aware that I am exposing my university-calendar to the public here. I

    -

    4.4.45. Dashboard: emacs startup screen

    +

    4.4.37. Dashboard: emacs startup screen

    This sets up the dashboard, which is really quite useless. But, it looks cool and makes me happy whenever I start an emacsclient without a file name as argument :) @@ -16735,131 +15971,38 @@ This sets up the dashboard, which is really quite useless. But, it

    -

    4.4.46. vterm

    +

    4.4.38. vterm

     (use-package vterm
    -    :ensure t)
    +  :ensure t)
     
    -(defun sudo-find-file (file-name)
    -"Like find file, but opens the file as root."
    -(interactive "FSudo Find File: ")
    -(let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name))))
    -  (find-file tramp-file-name)))
    -;;; vterm/config.el -*- lexical-binding: t; -*-
    -
    -  ;; Original functions overwrites tramp path with a guessed path.
    -  ;; However it breaks if remote fqdn/hostname is not resolvale by local machine
    -  ;; could also break on port forwarding, multihops,
    -  ;; custom protocol such as: docker, vagrant, ...
    -  ;; *if* you try to shell-side configure them.
    -  ;; Easily testable with vagrant ssh port on localhost.
    -  ;; My workflow is to open a tramp dired on / of the remote to get a
    -  ;; "foothold" then open vterms from there.
    -  (defun vterm--get-directory (path)
    -    "[OVERLOADED] Get normalized directory to PATH."
    -    (when path
    -      (let (directory)
    -        (if (string-match "^\\(.*?\\)@\\(.*?\\):\\(.*?\\)$" path)
    -            (progn
    -              (let ((user (match-string 1 path))
    -                    (host (match-string 2 path))
    -                    (dir (match-string 3 path)))
    -                (if (and (string-equal user user-login-name)
    -                         (string-equal host (system-name)))
    -                    (progn
    -                      (when (file-directory-p dir)
    -                        (setq directory (file-name-as-directory dir))))
    -                  (setq directory
    -                        ;; Bellow is what i altered
    -                        (file-name-as-directory (concat (file-remote-p default-directory) dir))))))
    -          (when (file-directory-p path)
    -            (setq directory (file-name-as-directory path))))
    -        directory)))
    -  ;; Injects the payload to the vterm buffer.
    -  (defun me/vterm-load-config ()
    -    "Pass local configuration files to vterm.
    -
    -Allows remote vterm to be shell-side configured,
    -without altering remote config.
    -Also adds my personal configuration that does not rely
    -too much on external packages.
    -Prints a reasuring message to proove good faith."
    -    (interactive)
    -    (let (;; Bellow messages to reassure other users that look at history
    -          (reasuring-message (format "Configuring shell of user %s to be emacs comptible"
    -                                     user-full-name))
    -          (reasuring-notice "This action is shell local, it will not affect other shells")
    -          ;; Bellow lies my configuration
    -          (basic-func-script (f-read-text (concat (getenv "HOME")
    -                                                  "/.emacs.d/shells/sources/functions.sh")))
    -          ;; Bellow lies the vterm shell-side configuration
    -          ;; Must be sourced last
    -          (vterm-func-script (f-read-text (concat
    -                                           (file-name-directory (find-library-name "vterm"))
    -                                           "/etc/emacs-vterm-bash.sh"))))
    -      (vterm-insert (format "# START: %s\n" reasuring-message))
    -      (vterm-insert (format "# %s\n" reasuring-notice))
    -      ;; Create one single block in history
    -      (vterm-insert "{\n")
    -      (vterm-insert basic-func-script)
    -      (vterm-insert vterm-func-script)
    -      (vterm-insert "}\n")
    -      ;; End the single block in history
    -      (vterm-insert (format "# %s\n" reasuring-notice))
    -      (vterm-insert (format "# STOP: %s\n" reasuring-message))
    -      )
    -    )
    -
    -  ;; find-file-other-window does not works great on remote:
    -  ;; if given an absolute path on a remote host,
    -  ;; the path will be understood as a local file since no
    -  ;; tramp prefix is present, and bash does not care
    -  ;; about tramp prefixes.
    -  ;; Bellow we solve context before sending it to
    -  ;; ffow
    -  (defun me/vterm--find-file-other-window-wrapper (file)
    -    "Help vterm find a FILE."
    -    (find-file-other-window (me/vterm--ffow-resolver file)))
    -  (defun me/vterm--ffow-resolver (file)
    -    "Help vterm resolve FILE."
    -    (cond
    -     ;; "/sudo::"
    -     ;; doom--sudo-file-path do the trick for us
    -     ((s-starts-with-p "/sudo::" file)
    -       (sudo-find-file
    -        (concat (file-remote-p default-directory)
    -                (substring-no-properties file 7))))
    -     ;; "/" means we want the "Relative root"
    -     ;; try appending the remote prefix if relevent
    -     ((s-starts-with-p "/" file)
    -      (concat (file-remote-p default-directory) file))
    -     ;; we got a relative path
    -     ;; we don't need to help ffow to find it
    -     (t
    -      file)))
    -
    -  ;; The variable vterm-eval-cmds is a SERIOUSLY SENSIBLE variable !
    -  ;; Do not be the guy that adds RCE into their config !
    -
    -  ;; Allow customed ffow to be called from vterm
    -  ;; ffow should be as safe as find-file which is already trusted
    -  ;; we append our resolver that only manipulate strings,
    -  ;; Proove me wrong but i think it's safe.
    -  (add-to-list 'vterm-eval-cmds '("find-file-other-window"
    -                                  me/vterm--find-file-other-window-wrapper))
     
    -

    4.4.47. multiple cursors

    +

    4.4.39. multiple cursors

     (use-package multiple-cursors)
     
    +
    +
    +
    +
    +
    +

    4.4.40. Less logging

    +
    +
    +
    +(setq mu4e--log-max-size 1000)
    +(setq message-log-max 30)
    +(setq comint-buffer-maximum-size 50)
    +(add-hook 'comint-output-filter-functions 'comint-truncate-buffer)
    +
     
    @@ -16898,8 +16041,7 @@ This is where the theme for the whole OS is defined. Originally, this noweb-ref
    -
    -enable = true;
    +
    enable = true;
     base16Scheme = "${self}/wallpaper/swarsel.yaml";
     # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
     polarity = "dark";
    @@ -16922,7 +16064,6 @@ fonts = {
         # name = "FiraCode Nerd Font Propo";
         # name = "Montserrat";
       };
    -
       sansSerif = {
         # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
         package = pkgs.cantarell-fonts;
    @@ -16931,27 +16072,23 @@ fonts = {
         # name = "FiraCode Nerd Font Propo";
         # name = "Montserrat";
       };
    -
       monospace = {
         package = pkgs.nerd-fonts.fira-mono; # has overrides
    -
         name = "FiraCode Nerd Font Mono";
       };
    -
       emoji = {
         package = pkgs.noto-fonts-emoji;
         name = "Noto Color Emoji";
       };
     };
    -
     
    -
    -

    6. Appendix B: Supplementary Files

    -
    +
    +

    6. Appendix B: Supplementary Files

    +

    This section now holds some of the configuration files that cannot be defined directly within NixOS configuration. These files are usually symlinked using home.file.

    @@ -17180,7 +16317,7 @@ This is the stylesheet used by waybar. @define-color background-critical blue; - * { +* { border: none; border-radius: 0; font-family: "FiraCode Nerd Font Propo", "Font Awesome 5 Free"; @@ -17190,9 +16327,9 @@ This is the stylesheet used by waybar. } window#waybar { - background: transparent; - color: @foreground; - transition-duration: .5s; + background: transparent; + color: @foreground; + transition-duration: .5s; } window#waybar.hidden { @@ -17210,14 +16347,14 @@ window#waybar.hidden { #custom-right-arrow-dark, #custom-left-arrow-dark { - color: @background; - background: @background-alt; - font-size: 24px; + color: @background; + background: @background-alt; + font-size: 24px; } #window { - font-size: 12px; - padding: 0 20px; + font-size: 12px; + padding: 0 20px; } #mode { @@ -17244,21 +16381,21 @@ window#waybar.hidden { #custom-outer-right-arrow-dark, #custom-outer-left-arrow-dark { - color: @background; - font-size: 24px; + color: @background; + font-size: 24px; } #custom-outer-left-arrow-dark, #custom-left-arrow-dark, #custom-left-arrow-light { - margin: 0 -1px; + margin: 0 -1px; } #custom-right-arrow-light, #custom-left-arrow-light { - color: @background-alt; - background: @background; - font-size: 24px; + color: @background-alt; + background: @background; + font-size: 24px; } #workspaces, @@ -17290,20 +16427,20 @@ window#waybar.hidden { #workspaces button { - padding: 0 2px; - color: #fdf6e3; + padding: 0 2px; + color: #fdf6e3; } #workspaces button.focused { - color: @foreground-warning; + color: @foreground-warning; } #workspaces button:hover { background: @foreground; color: @background; - border: @foreground; - padding: 0 2px; - box-shadow: inherit; - text-shadow: inherit; + border: @foreground; + padding: 0 2px; + box-shadow: inherit; + text-shadow: inherit; } #workspaces button.urgent { @@ -17348,8 +16485,8 @@ window#waybar.hidden { color: @foreground-error; } #memory { - /*color: #2aa198;*/ - color: #fdfd97; + /*color: #2aa198;*/ + color: #fdfd97; } #cpu { /*color: #6c71c4;*/ @@ -17363,7 +16500,7 @@ window#waybar.hidden { #battery, #custom-pseudobat { - color: cyan; + color: cyan; } #battery.discharging { color: #859900; @@ -17439,9 +16576,9 @@ window#waybar.hidden {
    -
    -

    6.4. justfile

    -
    +
    +

    6.4. justfile

    +

    This file defines a few workflows that I often need to run when working on my configuration. This works similar to make, but is geared towards general tasks and as such requires no extra handling (as long as there are no dependencies involved) or .PHONY recipes.

    @@ -17453,40 +16590,40 @@ This file defines a few workflows that I often need to run when working on my co
     default:
    -  @just --list
    +@just --list
     
     check:
    -  nix flake check --keep-going
    +nix flake check --keep-going
     
     check-trace:
    -  nix flake check --show-trace
    +nix flake check --show-trace
     
     update:
    -  nix flake update
    +nix flake update
     
     iso:
    -  rm -rf result
    -  nix build .#nixosConfigurations.iso.config.system.build.isoImage && ln -sf result/iso/*.iso latest.iso
    +rm -rf result
    +nix build .#nixosConfigurations.iso.config.system.build.isoImage && ln -sf result/iso/*.iso latest.iso
     
     iso-flake FLAKE SYSTEM="x86_64" FORMAT="iso":
    -  nixos-generate --flake .#{{FLAKE}} -f {{FORMAT}} --system {{SYSTEM}}
    +nixos-generate --flake .#{{FLAKE}} -f {{FORMAT}} --system {{SYSTEM}}
     
     iso-install DRIVE: iso
    -  sudo dd if=$(eza --sort changed result/iso/*.iso | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
    +sudo dd if=$(eza --sort changed result/iso/*.iso | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
     
     dd DRIVE ISO:
    -  sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
    +sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
     
     sync USER HOST:
    -  rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/
    +rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/
     
     
    -